Step 5

Hitting the enemy!


Now let’s create what happens when our projectile hits the enemy.

First set up an overlaps block for when ‘Projectile‘ overlaps other Sprite of kind ‘Enemy‘.

Set up 2 destroy blocks, one for otherSprite and for sprite.

Add a change score by 500 for each bat we hit!

Losing hearts!


Next we’ll create what happens when a bat touches our player.

Create a new overlaps block for when Player overlaps otherSprite kind of Enemy.

Set up a change life by -1 and a destroy block for otherSprite.

Spawn the enemy


Lastly, create how often the enemy spawns in the game.

Set up a on game update every ‘2000’ ms block

Add call ‘createEnemy’ function.