Godot 3.5: Let's Build a 2D Platformer!: Part 22 (Hearts Counter, Lives, & Singletons)

Опубликовано: 12 Февраль 2025
на канале: BornCG
15,411
407

Thanks for watching! In this Godot Game Engine tutorial I cover how to add lives to your game (collide with an enemy or fall off a cliff and you'll lose a life!) + an on-screen Hearts Counter Heads-Up Display. Here are the video chapter timecode links:

0:00 - Video Intro
0:13 - This mini-series
0:47 - In this tutorial (overview) + example
1:35 - The Current HUD + HUD Basics
3:08 - Importing the Heart Sprites (see download mirror links below)
4:21 - Scaling current HUD Elements
5:50 - Adding the HUD Hearts with a Texture Rectangle
8:31 - Duplicating for Empty HUD Hearts
9:25 - Making a Singleton Code File
10:41 - Creating a Lives Variable (& Max_Lives)
11:35 - Autoloading the Singleton
12:41 - Making the Hearts show Lives
18:35 - Loading & Refreshing the Hearts
19:19 - Losing a Life on Enemy Side-Collision!
23:50 - Making a 'Lose Life' Function
25:02 - Making a Global HUD Pointer Variable
27:05 - Go to Game Over when you're out of lives.
29:21 - Falling (off a cliff) to Lose a Life
34:13 - Restarting the Game with Full Lives
36:06 - A Few Outstanding Areas for Improvement...
37:07 - Wrapping Up, Call-to-Action, Social Media, Video Outro

*note: In this video I use Godot 3.5 Release Candidate 1.

#godotengine #gamedev

Play the Full Platformer Game Online Now!: https://borncg.itch.io/
*****************
DONATE to support my channel via PayPal: https://goo.gl/ThkwyG
****************
DOWNLOAD the Heart Sprites here (now FIXED!):
MIRROR 1: https://bit.ly/3xesSKK
MIRROR 2: https://www.dropbox.com/s/1i5z13a10dx...
****************
Get the Godot Game Engine at: https://www.godotengine.org/
****************
LIKE and FOLLOW me on:
FACEBOOK:   / borncg  
INSTAGRAM:   / born.cg  
TWITTER:   / borncg  
Reddit:   / borncg  
**********************************
Visit my Godot 3 Tutorial Series playlist!:
   • Godot 3 Tutorial Series  

Visit my Let's Learn Blender! Tutorial Series playlist:
   • Let's Learn Blender!  

Visit my Blender 2.7 Tutorial Series playlist:
   • Blender 2.7 Tutorial Series  

Also check out my Blender Game Engine Basics Series playlist:
   • Blender Game Engine Basics Tutorial S...  

My Blender Video Effects Playlist:
   • VFX in Blender Tutorial Series  

My Character Rigging (Minecraft) Mini-Series Playlist:    • Blender Mini-Series: Character Creati...  

****************
Nicolas from the band 'The Lazy Saviours' created my Intro Jingle! Check out his band's album here:
on Amazon: https://amzn.to/2CID1nz
on iTunes: https://apple.co/2QgqHOU
[not a sponsor]
****************