Monday, 17 October 2016

Sonic Reflection

Sonic is a platform and arcade game.
For this game the most important feature of this game is that the platform is scrolling.First of all I created the main scene and an actor named background.For this actor I added the behavior move and changed the direction 180-means that the actor will move to the left.The next step was that I created a new attribute (boolean) scroll.Then this attribute helped me to create a new rule which says that when the attribute is false and the x position is getting less or equal to half of the image ,there will be spawn an actor-the background at the back of the layer.
Then in this game I created a new actor-the platform where I added two new attributes start Y and platspawn .Start Y helped me to create a new rule where 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 creating the coin actor I just did a copy of the platform actor because the coin has the same behaviors and attributes as the platform.
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.
Then with the help of count attribute I made I rule which says that when the sonic collects 10 coins ,will change the scene which will display the text :You win.
And lastly  when the sonic is falling down ,out of platform the game will be reset.

For my own game I will need new behaviors and rules that I learned and used in this game.The main feature is the scrolling background but also change attribute,spawn actor and constrain attribute.

No comments:

Post a Comment