I've learned something new from Stencyl, it's called regions. It's use to move from levels to levels or entering doors by just having the player enter that region. Instead of clicking mouse to change scenes, just control the player to enter that area and *poof* you are in a new world.
I followed the tutorial from here :
http://www.stencyl.com/help/view/regions/
Here's the code that I've added in at the scene, in this case it's level 1:
And the region that I've created in the scene layout, it's that small box labelled "cave 1" :
Initially, when I've tested it, Bawang Putih went behind the cave instead of in front of it. I found the solution in a forum : http://community.stencyl.com/index.php?topic=13219.0 , and it's like photoshop's layering. All I have to do is to set Bawang Putih's layer to be in front of the cave. And the cave to be behind.
Moving on, I tried making the onions spit poison. I've drawn the poison, I need 4 frames to make it spin at 40ms per frame :
Here's a closer view :
And the settings that I've set for this poison spit :
After reading tutorials, I find out that I needed to use Attributes, I'm was not really clear as to what is attribute before I started this, but now I understood more what is attribute.
Based on this tutorial : http://www.stencyl.com/help/view/attributes/,
Attribute is to allow creators to make changes easier rather than to go back to the codes. That's my understanding. So create attribute is from this :
Then I'll get this :
I've done it before, but I just didn't realise that's how I get the changeable values like the image above.
Okay moving on, (this section is a bit complicated, I can understand a little bit from it.) I needed to refer to a default game from Stencyl as there's no detailed tutorial for it.
First I needed to create two new behaviours, the update position and enemy fire projectile :
The code needed in the fire projectile, there's 2 parts :
This code is to not let the onion immediately spit on Bawang Putih once the game starts, or not she would die before the game even starts :
This part is to let the spit find where is Bawang Putih's position and attack her :
Okay, then I put that aside. In the code above, there's a purple "Player Y" and "Player X", that's the game attribute which needed to be created in the settings :
This game attribute has to be created before I code the both behaviours.
And in the update position behaviour :
And then I linked it to the respective characters :
And now the onions will spit at Bawang Putih, but nothing will happen to her yet because I haven't code what will happen after the poison touches her, so the poisons are just collecting around her...eww.. :
I'm gonna add in on screen arrows and these are what I'm referring to:
Campbell B. 2013, Gravity.Duck Review. [electronic print] Available at: <http://www.148apps.com/reviews/gravityduck-review/> [Accessed: 2nd November 2013]
iappsin.com. 2013, Action Game Impossible Pixel for iPhone and iPad. [electronic print] Available at: <http://iappsin.com/action-game-impossible-pixel-for-iphone-and-ipad.htm> [Accessed: 2nd November 2013]
I've also downloaded their games to play on the Ipad, and I'm pretty comfortable with both of the games' arrow positions, but I think impossible pixel's game's arrow is more relevant to my game's gameplay because I only needed up, left and right. In gravity duck's gameplay, the players needed to switch gravity, therefore, the gravity button is on the right.
Sunday, 24 November 2013
0 comments: