Introduction to GDScript in Godot 4 Part 2

In this second part of the GDScript introduction, you’ll learn about state machines, adding and removing nodes and how to make a camera follow a node. By Eric Van de Kerckhove.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 5 of 5 of this article. Click here to view the first page.

Where to Go From Here?

Thanks for reading this tutorial to the end! You can download the project files using the link at the top and bottom of this page.
You’ve learned everything you need to know to get started with GDScript 2.0 in this tutorial:

  • The different kinds of variables declaration and various types
  • Referencing nodes in various ways
  • How and when to use signals and functions
  • Reading player input
  • Creating and using state machines
  • Node manipulation

To learn even more about Godot, take a look at its official documentation.
If you want a fun challenge, here are some suggestions to improve the game further to make it a more complete experience:

  • End the game if the avatar is falling for a long time
  • Show an end game screen with the achieved height and score
  • Keep track of high scores and show them in the UI
  • Add a title screen
  • Add obstacles to avoid while jumping
  • Add moving objects that award extra points when hit
  • Change the background when certain heights are reached
  • Add juicy effects like screen shake and light effects when a jumper is hit

We hope you enjoyed this tutorial. Leave a comment below or join the forum discussion to share your thoughts and ask any questions you might have!