In this video, I'll take a deep dive into fundamental game development, and build a platformer from the ground up. We don't just present a few SDL functions and call it a gamedev video, we do window management, drawing, game loop, animation, keyboard , collisions, audio, and bunch of other topics, this video is dense! We'll lay the foundation for building our own game engine.
#gamedev #cpp #sdl
Please support me on ko-fi:
https://ko-fi.com/constref
Join us on Discord to discuss:
/ discord
Source Code for Reference:
https://github.com/constref/sdl3-game...
Building latest SDL_mixer!
• Build SDL_mixer with SDL3 from source
Thank you!
00:00:00 Introduction and Video Description
00:01:09 Project Setup and Description
00:01:36 SDL3 with find_package and CMake
00:03:00 Visual Studio Presets and CMAKE_PREFIX_PATH
00:04:42 Building from the Command Line / Terminal
00:05:24 Linking with SDL3 with target_link_libraries
00:06:06 Initialize and Quit SDL
00:06:35 SDL Runtime DLL Path
00:07:28 SDL_main Setup
00:08:17 Error Handling and SDL_ShowSimpleMessageBox
00:08:37 Create a Window with SDL_CreateWindow
00:10:04 SDL Event Loop
00:11:01 SDLState Structure
00:12:04 Create the Render with SDL_CreateRenderer
00:13:01 Clear the Screen with SDL_SetRenderDrawColor and SDL_RenderClear
00:13:28 Flip Buffers with SDL_RenderPresent
00:14:41 Incorporating SDL_image
00:17:11 Load Image with IMG_LoadTexture
00:18:15 Draw Sprite with SDL_RenderTexture
00:20:12 Tell Visual Studio What currentDir to Use
00:20:57 SDL_FRect Texture Source Rect
00:21:31 SDL_SetTextureScaleMode for Nearest Neighbor Pixelated Scaling
00:22:16 Texture Desination Rect
00:23:03 Logical Game Resolution with SDL_SetRenderLogicalPresentation
00:24:15 Window Resizing
00:25:47 initialize() and refactor main()
00:27:03 Basic Character Movement and SDL_GetKeyboardState
00:30:44 Game Loop and Delta Time and SDL_GetTicks
00:34:35 SDL_FLIP_HORIZONTAL and SDL_RenderTextureRotated
00:35:46 Timers and Animations
00:40:00 Basic Resource / Asset Management
00:44:01 glm Math Library
00:44:33 Add glm library directly to codebase
00:45:17 Add glm using find_package
00:47:21 Setting up GameObject and GameState
00:50:29 Sprite Drawing with drawObject()
00:53:29 GameObject update() and Animation driver
00:54:07 drawObject Animation Refactor
00:55:30 State Management with a Finite State Machine (FSM)
00:57:59 GameObject type-specific data union
00:59:36 update() function
01:00:02 Improved Player Input and Movement
01:04:01 Player Deceleration
01:05:41 Running Animation
01:06:43 Tile Map Creation and Loading
01:10:40 More Tile Types
01:12:45 Gravity!
01:13:48 Collision Detection with SDL_GetRectIntersection
01:14:59 Collision Response / Resolution
01:18:53 Custom Collider Dimensions
01:21:03 Jumping Mechanics and Key Presses
01:24:49 Debug Text Rendering with SDL_RenderDebugText
01:25:29 Using std::format from C++ STL
01:26:30 Ground Sensor and isGrounded Flag
01:30:22 Running and Sliding
01:32:15 Game Camera and Viewport Setup
01:34:44 Parallax Background Layers and SDL_RenderTextureTiled
01:39:54 More Background and Foreground Sprites
01:43:53 SDL_SetRenderVSync to Enable VSync
01:44:21 Shooting / Bullet Particles and More Input Handling
01:50:21 Using LERP for the Bullet's x Origin
01:52:05 Shooting from All Player States
01:52:25 Improved Debug Text
01:53:02 Shooting from All States Continued, and Shooting Lambda
01:54:12 Player Shooting Tilesheets and Animations
01:57:14 Collider Debugging/Visualizing and Debug Mode
01:59:14 Blend Modes with SDL_SetRenderDrawBlendMode
02:00:00 Gravity Bug Fix / Grounded Flag Checking
02:00:51 SDL_HasRectIntersection Bug / Use SDL_GetRectIntersection
02:02:08 Bullet Collision Detection (Finally!)
02:03:37 Reuse Inactive Bullets / Limit Number of Bullet Objects
02:05:29 Remove Bullets Exiting the Viewport
02:08:24 Colliding Bullet Animations
02:09:29 Weapon Recoil with SDL_rand
02:10:57 Adding a Creepy Enemy
02:12:13 Add Enemies to the Map
02:13:02 Bullets vs Enemies (Collision Detection)
02:14:06 Flashing Damage Indicator
02:14:56 SDL_TextureColorModFloat
02:16:16 Enemy Hit and Death Animations
02:17:21 Enemy Health Points and Damage
02:18:21 Ignoring Collisions
02:19:05 Stop Animations from Repeating
02:19:28 Correct Animation and update() Sequence
02:21:13 Enemy Gravity and Level Collisions
02:21:46 Super Lazy Basic AI
02:23:19 Bounce Off Enemies
02:24:08 Audio with SDL_mixer
02:24:58 Compiling and Linking with SDL_mixer with CMake (SDL3)
02:27:55 Loading and Playing Sound and Music
02:31:34 Fullscreen Toggle
Project Code:
https://github.com/constref/sdl3-gamedev
Game Music:
Juhani Junkala [Retro Game Music Pack] Level 1
5 Action Chiptunes By Juhani Junkala.zip
https://opengameart.org/content/5-chi...
The SDL3 Audio Subsystem!
• The SDL3 Audio Subsystem!