Docs Cookbook
Stomp an enemy
Place an enemy (a Slime). In Properties, What is it? ▸ Enemy.
#Without code
- Place an enemy (a Slime). In Properties, What is it? ▸ Enemy.
- Switch to Advanced. With it picked, click + Add behavior ▸ Logic ▸ Trigger.
- Set When to Touched.
- Under If, + Add condition ▸ Code is true, and type its Code:
player.y > self.y + 0.5(the player is above it: they landed on top). - Under Then, change the first action to Remove object, then + Add action ▸
Launch player (Which way Straight up, Speed (tiles/s)
10) for the bounce, and + Add action ▸ Play sound (pop). - Try it: press ▶ Play and jump on the slime. Walking into it from the side still hurts.
#Quick code
Where it goes: on the enemy, Event: Player touches / steps on it.
if player.y > self.y + 0.5 then
self.remove()
launch("up", 10)
play("pop")
end
Get an email when Voxel Game Maker launches
It's coming to Steam with a launch discount. One email on launch day, the odd progress update, nothing else.