You can either manually handle rotation to point toward center and store array of zAngles as well OR you can simply calculate (actually Unity even has a method for it) to handle rotate to face center dynamically in your movement code.Ĭlick to expand.If the level is only 10 cells wide and 10 cells high that's 100 cells total yes. Meaning <0 becomes LevelPositions.Length - 1. When that variable (CurPlayerPosIndex) is less than 0 or >= LevelPositions.Length set it equal to other side of array boundaries. For counterclockwise movement decrement CurPlayerPosIndex. When player moves clockwise you increment a variable say CurPlayerPosIndex and use that get the coords of the next position to move to. This will map the Vector2 position to the array (at least as I recall it should. just set up public Vector2 array or list in game object with monobehavior then drag player over for each movement. This list of positions are your movement positions. And if centered at 0,0 often when doing top you will also get bottom offset and when doing left will have right. There are a small number of segments to travel across in each level so this is quick and easy. Then you take the player object (create player sprite if do not have one). It could be just an image displayed in Unity Sprite. On cell atm so can't easily make drawing etc to illustrate.īasically imagine in Unity Editor you have one of the Tempest level designs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |