Adding Behavior with GDScript

Since this game is mostly physics based we won't have to write much GDScript achieve our desired behavior.

In this section we'll focus on aiming and launching the projectile, as well as handling the win and lose states for this game.

Learning Goals

  • Become comfortable with GDScript
  • Learn to use the Script Workspace
  • Move a physics body with apply_force()
  • Become confident with exploring Godot on your own
Adding Behavior with GDScript
Spawning Projectiles
Point the AimLine node toward the mouse cursor
Collisions with Puzzle Pieces
Launch the Projectile