Solo Game: Week 2

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.

 

Waypoint code updated

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.

Waypoint gizmo code

Enemy waypoints

 

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.

Waypoints

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s