You can try to do some of the below to add more to your game
Extra Credit
1
2
3
4
5
6
7
8
9
10
11
12
Fruit Banana
Lets make a banana which will cause the monsters to slip off the ladders falling back down
Click on Add Sprite Icon click load sprite
Name the sprite spr_banana
Click on the Create Object Icon
Select the banana sprite and name the object obj_banana
Add a Mouse Right Released event drag in a display message
Type what the banana does like "Banana makes enemy's slip off ladders"
Add a Outside Room event and drag in a destroy instance of self
This process will be repeated for all the fruit just change the message that it says in the Right released event
Trees
The Tree will grow a special fruit that will do special things when thrown you can only carry one special fruit from the tree at a time
Lets Create the Tree Object
Save apple tree and turn it into a sprite call spr_appletree
Add a Create event to the tree
Add a Set Alarm0 give it 150 steps this is 5 seconds
Add an Alarm0 Event
Add a create instance of orange select relative and change the x value to 20
Apple Tree
Banana Tree
Cherry Tree
Pear Tree
Pineapple Tree
Berry Tree
Orange Tree
Make Character Pick up Fruit
Now we want your character to be able to pick up the fruit from the tree so it can be dropped on the enemy.
I will introduce you to the concept of variables now. We will use a variable to determine if we have picked up a fruit. If we have picked it up the variable will be equal to 1 if we have not picked up the fruit the variable will be equal to 0. By using variables we can test weather or not a condition has occurred kind of like a light switch it is either on or off but never both at the same time.
Open your person object go to the Create Event
Add a Execute code and copy the following variables into it;
execute code:
apples=10;
apple=1;
banana=2;
cherry=3;
pear=4;
pineapple=5;
berry=6;
orange=7;
fruit=apple;
This will intilize all the variables needed to pick up all the different fruits
Now add a collision event with the banana
Add a Set Variable action name it fruit give it a value of banana
Add a destroy instance action and select other
Make All Trees
Apple Tree
Banana Tree
Cherry Tree
Pear Tree
Pineapple Tree
Berry Tree
Orange Tree
Now we will make all our trees so we can put them in our other rooms.
The only thing we need to change is what fruit is created in the alarm0 event
Add an Alarm0 Event
Add a create instance of orange select relative and change the x value to 20
So replace the create instance with the correct fruit that the tree produces.
Make character drop correct fruit
Our character still drops the apple at this time but we want it to drop the fruit we just picked from the tree.
Open your characters object
Go to Key Press Event for Space
Delete the actions and replace with the code below using an Execute code . The code will switch the fruit you throw to the correct one you collided with. It will also decrease your apples by one every time you throw one.
execute code:
switch (fruit)
{
case apple:
if apples>0
{
instance_create(x,y,obj_apple)
apples-=1;
}
break;
case banana:
var obj;
obj=instance_create(x,y+30,obj_banana);
with (obj) motion_set(270,10);
fruit=apple;
break;
case cherry:
var obj;
obj=instance_create(x,y+30,obj_cherry);
with (obj) motion_set(270,10);
fruit=apple;
break;
case pear:
var obj;
obj=instance_create(x,y+30,obj_pear);
with (obj) motion_set(270,10);
fruit=apple;;
break;
case pineapple:
var obj;
obj=instance_create(x,y+30,obj_pineapple);
with (obj) motion_set(270,10);
fruit=apple;
break;
case berry:
var obj;
obj=instance_create(x,y+30,obj_strawberry);
with (obj) motion_set(270,10);
fruit=apple;
break;
case orange:
var obj;
obj=instance_create(x,y+30,obj_orange);
with (obj) motion_set(270,10);
fruit=apple;
break;
}
Draw Correct Fruit Character is holding
Now we have to draw the correct fruit that your character is holding
Open your characters object
Add a Draw Event
Add a Draw sprite action and select your characters sprite
Now add an Execture code and copy the below code it will switch to the correct sprite
execute code:
switch (fruit)
{
case apple:
break;
case banana:
draw_sprite(spr_banana,-1,x,y)
break;
case cherry:
draw_sprite(spr_cherry,-1,x,y)
break;
case pear:
draw_sprite(spr_pear,-1,x,y)
break;
case pineapple:
draw_sprite(spr_pineapple,-1,x,y)
break;
case berry:
draw_sprite(spr_strawberry,-1,x,y)
break;
case orange:
draw_sprite(spr_orange,-1,x,y)
break;
}
Create Other fruits
We have created apples and bananas but I will now show you how to make the other fruits
Now we need to make a fruit object so you can drop it on the enemy
Apple
Destroys one enemy you get 10 per level
Banana
Makes enemy slip off ladder
Cherry
Explodes on impact
Pear
Splits it half destroying
Pineapple
Explodes after a time destroying many enemies and walls
Berry
Slows enemy down
Orange
Destroys all enemies it hits
Cherry will be first it will explode on impact
So we need to make a sprite for the explosion effect.
Save this explosion strip this will b e animated
Click on Add Sprite Icon click load sprite
Name the sprite spr_explosion
Click on the Create Object Icon
Select the explosion sprite and name the object obj_explosion
Add a animation end Event
Add a destroy instance action and select self
Now we make the Cherry
Click on Add Sprite Icon click load sprite
Name the sprite spr_cherry
Click on the Create Object Icon
Select the cherry sprite and name the object obj_cherry
Add a Mouse Right Released event drag in a display message
Type what the banana does like "Explodes on impact"
Add a Outside Room event and drag in a destroy instance of self
This process will be repeated for all the fruit just change the message that it says in the Right released event So make all the other fruits if you havn't done so already
Cherry Explodes
Open the skeleton object so we can make the cherry hurt enemies
Now add a collision event with the cherry
Drag the Set Score Action and give it 25 points and check relative.
Drag destroy instance of self into the action
Drag another destroy instance action and select other
Drag the Create Instance Action into the event and select the explosion object check relative
Now add a collision event with the explosion
Drag the Set Score Action and give it 25 points and check relative.
Drag destroy instance of self into the action
Pear Splits
Now lets make the pear split apart
Save this sprite
Click on Add Sprite Icon click load sprite
Name the sprite spr_pearhalf
Click on the Create Object Icon
Select the pear half sprite and name the object obj_pearhalf
Add a animation end Event
Add a destroy instance action and select self
Open the skeleton object so we can make the pear hurt enemies
Now add a collision event with the pear
Drag the Set Score Action and give it 25 points and check relative.
Drag destroy instance of self into the action
Drag another destroy instance action and select other
Drag the Create Moving Instance Action into the event and select the pear half object check relative
Now add a collision event with the pear half
Drag the Set Score Action and give it 25 points and check relative.
Drag destroy instance of self into the action
Pineapple BIG EXPLOSION
Click on Add Sprite Icon click load sprite
Name the sprite spr_pineapple
Click on the Create Object Icon
Select the pineapple sprite and name the object obj_pineapple
Add a Mouse Right Released event drag in a display message
Type what the pineappledoes like "Explodes after a time destroying many enemies and walls"
Add a Outside Room event and drag in a destroy instance of self
Open the skeleton object so we can make the pineapple hurt enemies
Now add a collision event with the Pineapple
Drag the Set Score Action and give it 25 points and check relative.
Drag destroy instance of self into the action
Drag another destroy instance action and select other
Drag in a Create Random and add all the settings below
This will create 4 different explosions that will be placed randomly around the collsion with the monster so it can destroy many enemies and even walls.
Berry
Berry will slow down enemies
Click on Add Sprite Icon click load sprite
Name the sprite spr_berry
Click on the Create Object Icon
Select the berry sprite and name the object obj_berry
Add a Mouse Right Released event drag in a display message
Type what the banana does like "Berry slows down enemy's"
Add a Outside Room event and drag in a destroy instance of self
Open the skeleton object so we can make the berry hurt enemies
Now add a collision event with the berry
Add a set friction set it to .005
Drag destroy instance of self into the action
Orange
The orange will travel through all enemies it hits destroying them all
Click on Add Sprite Icon click load sprite
Name the sprite spr_orange
Click on the Create Object Icon
Select the orange sprite and name the object obj_orange
Add a Mouse Right Released event drag in a display message
Type what the orange does like "Will travel through all enemies destroying them all"
Add a Outside Room event and drag in a destroy instance of self
Open the skeleton object so we can make the orange hurt enemies
Now add a collision event with the orange
Drag the Set Score Action and give it 25 points and check relative.
Drag in a destroy instance action and self