Hello! This is my first post in Unity Script Forum, and i’m almost a totally newbie user.
I’ll try to explain what i want to achieve, and if someone could gently help me it would be really appreciate. C# Please if possible, i’m focusing on learning that language as starting. ^^
- The camera is orthographic, 2D, pointing on a tiled world (24x24 each tile: creatures, players, walls…)
- The player can move only if it is his turn
- The movement is grid-based
- The movement shouldn’t be allowed if the tile is occupied by enemy or wall
First problem, i don’t know how to set a proper array for my tile world. I mean, from zero. I understood (i hope so at least) that i store each tile data, but i dunno how to do it. Also, how to let the system know if the floor tile has a monster over it, and it isn’t reachable at that moment?
I would need really basic explanation, i tried to understand from forum posts or Unity answers, but they are already a step beyond my comprehension.
And, the array is fixed, or while the player move i can include different tiles depending on position? I mean, if the range of action cannot be in any situation bigger than the camera, could i use the camera dimension for the array, and while the active scene “moves” even the tiles included in the array change?
For movement, i use the C# - grid script i found in documentation, by Eric. It surely does it’s job, but as you can understand i don’t know how to check the tile (is it a wall, is it occupied by some npc?) so the player can move anywhere.
If you have an alternative solution, even without Arrays, you are welcome, please just start from a basic explanation.
As i’m learning, i don’t need a complete script, just basis to start working it out by myself. The biggest problem is that i think i can understand parts one by one, but i don’t know how to link it all together! In that case, i also need help on which-script/variable-is-linked-to-which-object in scene.
Thanks for reading,
Kind regards,
Kae