Time for action — adding an enemy and making him move
For the player to have some challenge, we are going to add a new enemy sprite into the game and give it some intelligence to move around the level. We'll also be giving the player some score points for jumping on the heads of the enemies.
1. In the Layout Editor, make a new sprite for your enemy object and draw some graphics for it. Use the following graphics as reference:
2. Add two more animations for this sprite, as we learned in the previous chapter. The first additional animation is the
Walking
animation, which has framesStep 1, Standing, Step 2, Standing
, and has no tag (as it will not use any behaviors). The second animation is theDie
animation and requires no extra frames or settings. Remember to set the animation speed of theWalking
animation.3. Now that our enemy sprite is animated, open its left-side Properties menu and change its name to
BadGuy
, then add the private variables Speed and Direction. Set the default value...