Build a Tower Defense Turret with Verse
verse-library
var Score : int = 0
# OnBegin runs automatically when the game starts.
OnBegin<override>()<suspends> : void =
# We wait for an Event.
# DestroyedEvent fires when the turret is destroyed, or we can use TargetFoundEvent.
# This means an enemy was hit by this turret.
loop:
# Block here until the turret finds a target (eliminates someone).
Turret.TargetFoundEvent.Await()
# When the event happens...
# Add one to our score.
set Score = Score + 1
# Print the score to the screen.
# This helps us see it working.
Print("Score: {Score}")