Tuesday, 18 October 2016

Sonic Minigame

This has the basic idea to jump from a platform to another and collect the coins the you collect 10 you win and you move to the next level. One important thing about this game is the fact that the sonic doesn't move from his initial place, he can only jump pressing the space. The background is moving left this make us think that the sonic is moving in reality isn't. We obtain this effect using the behavior  Move and we said to move the actor Background in direction 180 which is left. After using spawn actor we spawned the actor background behind of the first layer +480 pixels on self position. After when we obtained the good result which we wanted we start to do the platform. We created a new actor named Platform and we changed the size of it to 400x100 and we created 2 attributes one of type boolean and another real. We dropped in the behaviour change attribute  and we changed the x position of the platform to exp: 1024+(position X/ 2) this will help to respawn the platform after scene to look good. I learned a new behavior Constrain Attribute.This behavior is like a shield that will  permit the platform interact with the main characte-sonic and will not permit Sonic fall down at some moment when the gravity will be present in the game.Also for the platform  I created a rule that will permit the platform move left.In the same rule I added a spawn actor and also a timer.The rule is saying that a platform will be spawn  at random time (between 1,6/ 10) and also at random position between  -200 pixels and 200 pixels.
For the actor Coin we copied the actor Platform because this two actors has similar characteristics and this save time. I created a collide rule for the coin with the actor sonic the they collide the special sound is playing I inserted in this rule the destroy behaviour to destroy is after when sonic collided with coin. After we I did a rule to check the score, I did it using the rule which says when the coin overlaps or collapse with actor of type Sonic it change the attribute Score +1 and I did another rule with says if the game score is =10 change the scene to you win.
For the sonic actor I added  an animate picture.And the speed of this animate is 30fps. Also I used a constrain attribute-and the attribute that i constrained is the sonic x position to 150 pixel.This attribute helps the sonic to move to the left with 150 pixels and it helps to make the character more real.  Also in the sonic game I created the gravity.Also the sonic is colliding with the platform and the coin.Also I used a timer for the sonic.I created a controller for the sonic where,I setted a timer for 4 sec. that means that sonic will appear after 4 sec in the game.If we do not set a timer the sonic appear in the game and then is falling down because of the gravity and it can not collide with the platform and the coin.Also I made my sonic actor jump and in the same time play a sound.A sound is also played when the sonic is colliding with the coin and with the platform.For the coin I created a new attribute that counts how many coins a collecting and also when the sonic collides with the coin ,the coin is destroyed.

No comments:

Post a Comment