Goblin Splat 3D

Walk a 3D castle, squirt goo at goblins, find the key and get out. It shows how to shoot in a 3D level, with a health bar and an ammo counter.

How to play

โ†‘ and โ†“ walk. โ† and โ†’ turn. Space squirts a blob of goo and opens doors. The white cross in the middle shows where you aim.

The things in it

PlayerThe Hero with First-person (3D levels) movement.
GoblinChases another object: Player. It has a splat animation for when goo hits it.
Goo BlobThe shot. Floats in the air is ticked, so it flies at eye height. Disappears when it hits a wall is ticked too.
Goo, KeysCounters. Goo is how many shots you have left.
HealthA bar. Goblins take 20 each time they catch you.

The rules that matter

WhenPlayer pressed Fire 1Goo > 0Not more than every 0.25 seconds
DoPlayer shoots Goo Blob, the way it facesSubtract 1 from Goo

In a 3D level a shot leaves from the middle of the player, a little in front, so it goes where the cross points.

WhenGoo Blob collides with GoblinGoblin switch 1 is off
DoDestroy Goo BlobGoblin switch 1 onGoblin: change animation to splatStop GoblinGoblin fades outAdd 50 to score

Switch 1 means โ€œalready splattedโ€. The other rules check it, so a splatted goblin stops chasing and cannot hurt you.

WhenGoblin overlaps PlayerGoblin switch 1 is offNot more than every 1 second
DoSubtract 20 from HealthShake the screen

This uses overlaps, not collides with. Collides happens once, when they first touch. Overlaps stays true for as long as the goblin is on you, so it keeps hurting, once a second.

More about this in Shooting in 3D.

Still stuck?

Try the Chocobreak tutorial, open a sample game and read its rules, or look at the questions people ask.