Box Code Above

Create a new Group for hitting the box from above

Code Explanation

When the Player collides with the box

AND the Player is ON the floor

AND there is NO wall to the left

AND there is NO wall to the right

Reset the Double Jump ability of the Player

Make the Player Jump

Play the Hit Animation of the Box

Subtract one from the Durability of the Box

Spawn random fruits

Set the Fruit to be moveable

Add a force in a random direction the fruits


NOTE:

The code checking if there is a wall to the left or the right is OPTIONAL.

This is a design decision.