Godot 4 3D Platformer Lesson #17: Counting Coins to Win! + Singletons @BornCG
Godot 4 3D Platformer Lesson #17: Counting Coins to Win! + Singletons  @BornCG
Uploaded October 2024 | Updated September 2026, 2 weeks ago
In this lesson I'll show you how to create a 'singleton' - a global code file, which we'll use to keep track of the collected number of coins. We'll also code the ability to win the game! ...each time a coin is collected, we'll see if the *number of coins to win* has been reached, and if so, we'll change scenes.

Thanks for watching! Here are the video chapter timecode links:

- 0:00 - Video Intro
- 0:13 - Lesson Overview
- 0:48 - Adding multiple coins!
- 3:08 - Creating a Singleton Code File
- 5:09 - Autoloading our Singleton code file
- 6:37 - Adding 1 to 'coins' each time a coin is collected
- 8:53 - Winning the Game! (by collecting all the coins)
- 12:49 - Fixing a bug: Resetting 'coins' variable on Level Load
- 15:26 - Wrapping Up: This Lesson's Code
- 15:55 - Wrap-Up & Outro

Don't forget to LIKE & SUBSCRIBE! 🥰 👍

*note: in this lesson I use Godot 4.1

Play and Download the Finished 3D Platformer Game Online Now!: borncg.itch.io/3d-platformer-game (use: Chrome/Edge/Firefox to play the web game version)
*****************
DONATE to support my channel via PayPal: goo.gl/ThkwyG

********************************
LIKE and FOLLOW me on:
FACEBOOK: facebook.com/BornCG
INSTAGRAM: instagram.com/born.cg
X / TWITTER: twitter.com/BornCG
Reddit: reddit.com/u/BornCG
**********************************
Visit this Godot 4 Beginners: 3D Platformer Course playlist!:
youtube.com/playlist?list=PLda3VoSoc_TTp8Ng3C57spnNkOw3Hm_35

Visit my Let's Learn Blender! Tutorial Series playlist:
youtube.com/playlist?list=PLda3VoSoc_TQrLrt-voecHs0Mb5qzk2S3

****************
Nicolas from the band 'The Lazy Saviours' created my Intro Jingle!
****************
Godot 4 3D Platformer Lesson #17: Counting Coins to Win! + Singletons#5: Sky Color vs Sky Light #blender3d #b3dBlender 2.8: Rendering to a Movie FileBlender Game Engine Basics Tutorial #12 : In-Game Animation #b3d #gamelogicGodot 3.2: Lets Build a 2D Platformer!: Part 4 (Poses, Walking, Flipping) #godotengineBlender 2.7 Tutorial #80: Painting & Texture Brushes (Part 2) #b3dBlender VFX Tutorial #13: Lightsaber Duel (Part 1) #b3dBlender 2.7 Tutorial #56 : Wind & Waving FlagsBlender 2.7 Tutorial #64: Lego Character Animation #b3dBlender 2.8 #0: Beta Overview #b3dGodot 4 3D Platformer Lesson #15: Collision Layers & Masks!Blender 2.7 Tutorial #83: Carving a Jack-o-Lantern #b3d
BornCG |

Godot 4 3D Platformer Lesson #17: Counting Coins to Win! + Singletons

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER