Shooting Bullets and Creating a Timer - Godot 4 Tutorial - Pt 12 - 2D Platform Game

Опубликовано: 30 Май 2026
на канале: Rapid Vectors
18,832
487

Part 12 - This tutorial will teach you how to create a player animation for shooting and then instantiate a bullet from a muzzle that is attached to the player. The direction of the bullet will also change when the player's direction changes. A timer is used to remove the bullet from the game play, which will free up resources when many bullets are fired in the game. This tutorial will help you get started with creating a 2D platform game using the Godot game engine.

Download the following Game Assets (the link has been changed since recording the original video)
Created by @ansimuz
💡 https://ansimuz.itch.io/gothicvania-p...

Download the ZIP file and the assets are under the warped-caves folder in location
Legacy Collection\Assets\Packs\warped-Caves

Download the following Game Assets (OLD ASSET LINK)
Created by @ansimuz
💡 https://itch.io/queue/c/463790/warped...

Subscribe to my channel for more tutorial updates
🔔    / @rapidvectors  

My code scripts are at my GitHub account
🔔 https://github.com/rapidvectors/tutor...

Would you like to buy me a coffee?
☕ https://www.buymeacoffee.com/rapidvec...

🎬 Video Chapters
0:00 - Introduction
0:30 - Create a player shooting animation
1:26 - Create the bullet
2:45 - Create the player shooting function
3:20 - Add a keyboard input for firing the bullet
5:30 - Create the muzzle for the gun
6:20 - Preload the bullet in the player scene
7:05 - Fire the bullet
8:30 - Add the bullet script
9:10 - Add a Timer to remove the bullet when fired
10:44 - Flip the muzzle based on the player direction

#godot #godot4 #godotengine#indiegame #indiedev #indiegamedev #tutorialyoutube #gamedev #gamedevelopment #gamedevelopmenttutorial #godottutorial #debugging #gdscript #parallax #parallaxeffect