Someone ask me to help him or her to build Food Slicer game. Where different kind of fruits shootout from bottom and player has to slice the fruits and get score too. Well I am sorry I am not here to make or build any type of game for anyone but, that does not signify that I won’t help. Therefore I have come to a decision that I will write small tutorial. So the person or persons in question will learn something from it. Who knows one day might become good game maker too. Good luck.
Starts construct 2 and set all your dimensions below:
1. Set windows size to 640 X 480
2. Layer size 640 X 480
3. Create 4 layers name them Background, Fruits, Player, HUD
4. Please remember to set HUD PARALLAX 0, 0. You do not need it but, it is always good because you might forget to do with larger layer.
Add Mouse and Touchpad as new objects
Insert any background your choice and then lock the layer. Now on layer fruit add fruit sprites and name them as wish. Mine is strawberry and grape. For this tutorial I have only these sprites but, you can add many as you like.
Sprites will be needed for slice strawberry and grape sprites too. Also make one sprite for spawning. Could be square like this:
Place spawn sprite at bottom of layer at 320,480
Sprite strawberry and grape looks like this
New sprite and call it player or whatever you wish looks like this
Now we add behaviours to our objects. This is player so the behaviour we need is FADE
Strawberry sprites needs bullets behaviour set it like below etc
Do same for grapes sprites as well. Please remember to add bullets behaviours to sliced fruits as well:
Now click on Events Editor
Here we need Global variables add this to code
Enter this code for Player
Enter this code for rest and test it it should work fine. If not I have included the capx for this check it
Please remember this work is so simple. There are many ways to improve this game. One could use array, instance variables, loops and like I said it's up to each and everyone of you. We are here to help but as I said before not here to build you full game. We can guide you towards your goal but kicking the ball in goal is your work and effort.