In my previous post, all the poison spit did was to hit Bawang Putih like a tennis ball and piled up around her. I searched tutorials and the coding I did was actually a few combinations of the tutorials.
This is one of the tutorials I referred to : http://www.stencyl.com/help/viewArticle/109/ , but the tutorial's hp bar didn't work for me, it didn't appear anywhere on the screen and I couldn't solve it as for now. So, I moved on to analyse some of the default's game and my first stencyl tryout's code. Because I did made the player die and reload before.
There is a behaviour called "die in pit" in my first tryout. That means when the player goes to the edge of the screen or fall into a hole, the game will reload and revive the player.
But my game does not have any pitholes to die in. Only the poison will kill the player. So, I use the collision method. I set it that when the player collides with the poison, the player dies. After player dies, the screen will reload. I've also found a feature in stencyl which shakes the screen. I combined the codes to this :
And as for the poison, it must disappear when it touches the tile or objects in the path and my player. Using the same collision method, I set it to kill itself:
Then I get these behaviours :
And attach it to respective actors :
And the results :
Thursday, 28 November 2013
0 comments: