0

Completed sound/music and game icon/splashscreen

I've finally finished the sound and music part for my game. There was a part where I did my own trial and errors with the coding as I couldn't find a tutorial for it. It is the onion's sound. Initially, I added the code into the scene, where the scene will play the sound every 7 seconds or so. But I realised it will not make sense having the onion's sound still playing when they are not on the screen after being stomped by Bawang Putih. So, I moved the code into the actor instead. The onion's event tab. First, the codes that I used was these :




All the above 3 were my trial and error codes. They didn't work, so I made the code simpler, which ends up being the one that works :


The channels in the code are like sound groups, so I can add in sounds to certain channels and those sounds will be in the same group. 

Moving on, I added sounds to be played in sequence during my still images scenes, the quest pages and end pages. 

I just have to set it to play at certain seconds, so it will play after one another :
I have to code these in the scene's event tab.




When I tested exporting to swf, Stencyl wouldn't allow me to export it due to some incompatible sounds format. It is really a hassle as Stencyl does not have the feature which allows me to see which is the sound that is incompatible. The only way to solve this is to delete one sound after another till it is able to export to swf, then only I will know which sound is causing the problem. After finding that incompatible sound, I have to convert it to this format :


After having that done, I tried exporting again, but it still gives me the same error. Stencyl also doesn't let you know how many sound is incompatible. So, in the end I found around 5 sounds that I have to reconvert by going through the delete and export process. It does took up most of my time, I will have to take note of the sound format in the future. 

Other than that, I've changed all the keyboard features to touch features. (I hope I didn't miss out any of the keyboard features)


Instead of "touched" I use "is touching", so the animation will be shown.

And I have also done the game icon and splash screen. Stencyl noted in their programme that the icon must be at least 144px x 144px while the splashscreen for ipad must be at least 1536px x 2048px. 

Here's my icon design and the splashscreen. 



I don't know how the transition will be like from splashscreen to game menu, but I wanted the splashscreen to have the game menu's background, to show the starting scene. 

Here's the result:

Gameplay 1 :



Gameplay 2:


0

Ending scene, onscreen arrow keys , sound effects, pausing and adding touch features.

Before I get to the things that I've done, recently I've been receiving this error :


I searched for solutions and came across this forum which solved my problem :


I have to disable this feature to stop my game from crashing all the time :


And now it works perfectly fine!

END SCENE :
Okay, moving on, I've included an end scene where after Bawang Putih meets the last Onion, she enters her house and finds Bawang Merah trying to cook her magical fish.





And she threw one of Bawang Merah's onions towards Bawang Merah and she saved her fish and lived happily ever after.

ONSCREEN ARROW KEYS

I've also added on screen arrows. It's quite confusing at first to understand how to make the screen arrows to work. I still dont know if it will work on touch if it's on the ipad, but it does work on the screen so far. 

What I did was, I created the arrows and placed them into the same group as my buttons. I wanted the arrows to follow the screen and not be fixed on the screen. And I found out about this feature while looking through the forums :


It's called anchoring self to screen. So, the object or actor, if this feature is used, it will follow the screen. 


Then I set the arrow to simulate keyboard controls. I found out about the simulation here :



And I attached these behaviours to my left, right, and up arrow. I've attached the anchoring to the pause button but not the simulation.

Now it follows the screen whenever the player moves :


SOUNDS

Now that the arrows are done, I moved on to do sound effects. For Stencyl , I only can use mp3 files to add in sound. It doesn't support wav files so far in my Stencyl's version. Perhaps in the future it might be able to support different formats. 

I haven't finish adding the sounds and music, it's in progress. Nevertheless, this is how I add in the sounds :

First, I import the files:


Then I go to the behaviours where I want the sound to be played and include this code in the behaviour:


There are options to loop or stop the sound when changing scenes. Sound effects and music are quite simple to be placed into the codes in Stencyl.

PAUSE GAME

In my levels, I have a pause button which allows players to pause their game. The pausing part is the main issue for me as it is quite hard. My pause button still does not work but I can pause the game using the "enter" on the keyboard. 

Anyway, I followed this tutorial here :



For pausing, I have to create a behaviour for the scene, in this case level 1 and level 2, 


In the Pause Game 1 behaviour are these codes:


The codes mean, if I pressed Enter on my keyboard, if game is paused, then unpaused the game. If not, show the two buttons and pause the game. 

The two buttons I've created in the actor types section. And each button have their own behaviour, the menu button will fade the screen and go back to menu. Whereas, the play button will resume the game. (unpausing the game)

And I replaced the keyboard features to touch feature for mobile, but I can't test the touch features because it wouldn't work on the keyboard. So, I temporary disabled the touch features to continue my desktop testing. 

Here's the results so far :




0

Poison can kill

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 :









0

Level 1 to Level 2 and onion shooting poisons

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. 


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. 


0

Level 2's background

I've drawn level 2's background. I'm thinking of placing a small cave to link both levels. So Bawang Putih will have to go through that cave to proceed to the next level.



I'll be adding bigger rocks and place the enemies on it so Bawang Putih will have to jump on the rocks to stomp the enemy.