My targets today were to
- Make a map (sub goal: add collision to map)
- Add movement to the main character
- Add a goal object
- Add enemy and enemy collision
- Enemy movement
I made a very quick map, which I will later replace with a more visually pleasing one, but for now this simple map will do. I then brought in the map, main character and enemy. I typed out and attached the walking code to Mercy, and added colliders to her, the enemy, and the map so that things couldn’t go though eachother. I also made a super quick representation of the collectable item so that there was a goal object in the map, which I will later replace with what I really want it to look like.
I then made a waypoint path for the enemy to follow. I did this by first making a code that uses arrays to make a list of “waypoints” that the enemy follows to trace a path. This code makes the enemy move on a particular path using vector transforms and arrays to keep them in the order that they need to be in.
For my actual code, I added some code at the end that allowed me to see the path that I had traced. This code allows you to see the path with a coloured line to represent the path it takes. It is more of a cosmetic feature that makes it easier for the programmer to see, but it is very useful.
I managed to make the enemy trace a path along the bottom of the map to make it a little harder to get to the goal. This is going to be more useful when I add kill collision to the enemy, but for now it shows the path that you shouldn’t go near and it is useful.