Box Code Below
Create a new Event Sheet for the Box
Create a new Event Sheet for the Box
Hitting box from below
Hitting box from below
Code Explanation
Code Explanation
When the player collides with the box
When the player collides with the box
AND the player is NOT on the floor
AND the player is NOT on the floor
AND the player does NOT have a wall to their LEFT
AND the player does NOT have a wall to their LEFT
AND the player does not have a wall to their RIGHT
AND the player does not have a wall to their RIGHT
Move the Player DOWN after colliding with the box
Move the Player DOWN after colliding with the box
Play the HIT animaton of the box
Play the HIT animaton of the box
Subtract 1 from the durability of the box
Subtract 1 from the durability of the box
(This determines how many hits before the box breaks)
(This determines how many hits before the box breaks)
Spawn fruit from the box
Spawn fruit from the box
Set the Fruits Physics Property to moveable
Set the Fruits Physics Property to moveable
Apply a Physics force to the fruits to send them in random directions.
Apply a Physics force to the fruits to send them in random directions.
NOTE:
NOTE:
The code checking if there is a wall to the left or the right is OPTIONAL.
The code checking if there is a wall to the left or the right is OPTIONAL.
This is a design decision.
This is a design decision.