torsdag 8 januari 2015

Level EE

Another eventful day at Daphenie Games.

Today we created fearful enemies to our poor and defenceless player. If the player collides with an enemy object (a cube) then the player "dies" and respawns at the start point.

To make it a bit more difficult for our protagonist the enemy is moving back and forth between two points. To make this happen the enemy has a starting, then we program it to move towards another point with a certain speed, until it reaches that point. Then it does it again in reverse. We also tagged the enemy (the game object) with the tag "Enemy". Then in the Player script we added a OnCollision method so that the player would only be affected if it collided with an object with a "Enemy" tag and not all objects (such as floor, walls etc).

Lastly we also added a small animation of the death of the player. We did this by using the built-in particle system that would be initiated when a player collides with an enemy. For the collision we chose a Sprites animation (which looks like small cubes) then the cubes "explodes" randomly between two different sizes. This, for a more realistic explosion.


This picture is exactly after a player has collided with the enemy (note the white sprites that are left from the explosion). The enemy is beige and the player is blue - and currently respawning at the starting point. The green transparent cube is the finishing goal. However, at the moment, nothing happens when the player reaches the goal. 

(Still waiting to get our project approved though....)

Peace out,
Daphenie Team





Inga kommentarer:

Skicka en kommentar