In my screenshot, you can see i have added enemies. This is how i created it:
Information about object: bear (enemy)
Sprite: bear
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Mask:
Create Event:
start moving in directions left and right, with speed set to 5
move in direction 270 at most 12 till a contact with solid objects
//Makes the enemy move left and right, and sit on the block, not above it.
Step Event:
if relative position (1,1) gives not a collision with Only solid objects
reverse horizontal direction
if relative position (-1,0) gives a collision with Only solid objects
reverse horizontal direction
if relative position (1,0) gives a collision with Only solid objects
reverse horizontal direction
if relative position (-1,-1) gives a collision with Only solid objects
reverse horizontal direction
//Makes the enemy bounce off the side walls, and change direction if there is not a platform under it.
Collision Event with object jumper:
for all jumper: jump to the start position
set the number of lives relative to -1.
// Makes the jumper lose lives when it hits the enemy and return to the start.
Information about object: jumper
Create Event:
set the number of lives to 3
//Makes the jumper have 3 lives
Step Event:
If lives are smaller than 0
end the game
//Makes the game end if the jumper has no lives left.