Skip to main content

Chapter 8a - Mini arena

Put the pieces together​

You now have:

  • Vector2 β€” real engine math
  • Player / Enemy β€” simple actors
  • CharacterBody / RigidBody / StaticBody β€” movement styles
  • Area2D β€” triggers and pickups

This chapter is a short arena loop using the kit only (still mocked β€” no editor scene).

var Kit = preload("res://game_kit.gd")
var game = Kit.make_game()
var foe = game.spawn_enemy(Vector2(80, 0))
var goal = Kit.make_area(Vector2(120, 0), 12.0)
# move, chase, check overlaps…
πŸ§ͺ Tick toward the player

Mini quiz β€” arena design​

Quiz

Arena design

1 / 2

game.tick(delta) in the kit mainly

Pick an answer to see if you are right.

Challenge: one chase step​

Spawn an enemy at x=100, set its speed = 25, call game.tick(1), print int(enemy.position.x).

Player stays at origin. After one second of chasing toward the player, x should be 75.

75

Exercises​

Activity: Score bump

make_game(), call add_score(10) twice, print score.

20