Learning SDL2 in 48 Hours - GMTK Game Jam 2020

  • Published on Jul 19, 2020
  • I used the 2020 GMTK Game Jam as an opportunity to try to learn how to use C++ with SDL2, a low level audio, input, and graphics library that you've probably heard of. In 2 days I was able to put together a simple game, and I learned a lot along the way!

    Check out Cursor Custodian here: polymars.itch.io/cursor-custo...
    → Source code: github.com/PolyMarsDev/Cursor...
    Twitter: PolyMarsYT


    0:00 Intro
    1:03 Preparations
    2:06 First Prototype
    3:03 i am addicted
    3:20 Prototype Code Explanation
    4:15 Player Art and Animations
    5:17 Adding Gameplay
    7:18 Finishing Up and Submitting
    7:29 oops
    8:03 Conclusion

    ---Resources/libraries used---

    C++/SDL2 RPG Platformer Tutorial for Beginners Part 1 | Setting up SDL2 on Windows - codergopher

    Emscripten - emscripten.org/

    SDL2 - www.libsdl.org/


    "Wallpaper" - Kevin Macleod ( incompetech.com )
    "Moon Base" - Evan King ( www.youtube.com/watch?v=orooE... )
    "Getting it Done" - Kevin Macleod ( incompetech.com )
    "Biscuits" - Evan King ( www.youtube.com/watch?v=OMHEd... )
    "Alpha Channels" - Evan King ( www.youtube.com/watch?v=T-Dft... )
    "Sneaky Snitch" - Kevin Macleod ( incompetech.com )

    ---If you liked this video, here are similar ones you might enjoy!---

    Vimlark - Making a game in 48 hours! - GMTK Game Jam 2020 (Indie Game Devlog)
    KaleChippsDev - Making a [Story] Game in 48 HOURS! | GMTK Game Jam 2020
    BenBonk - The Making of Package Patrick - GMTK Game Jam 2020
    Sam Hogan - I Made a Zero Player Game
    Randall - Programming a New Physics Engine for my Game
    Dani - I Made a Game in 48 Hours!
    Blackthornprod - LUDUM DARE 42 - Making of EVOLUTION
    Jabrils - 🖥️ Making A Game in 48 Hours!

Comments • 1 944

  • PolyMars
    PolyMars   +291

    part 2:

  • Sam Hogan
    Sam Hogan Year ago +7

    Geez learning a new framework for a game jam, wouldn't expect anything less from you haha. Nice work!

  • nullFoo
    nullFoo Year ago +224


  • SD Gaming Pamilia
    SD Gaming Pamilia Year ago +1

    "The square moves away from the cursor"

  • Crep 50
    Crep 50 Year ago +1


  • Fun From Above

    Love the concept, love the art style, would love to see a revisit to this game eventually.

  • Declan S
    Declan S Year ago +96

    Add a feature where if you hit something, then the character follows the mouse for a certain amount of time. So if you make the mouse a ghost, you can collect something that makes the ghost blue (like pac man) and if the character touches the blue ghost you die.

  • Rob Lang
    Rob Lang Year ago +19

    I'm impressed that you choose a new library each game jam! I can see the benefit of it; you're time boxing your analysis of the library while making something complete without procrastination.

  • Evelyn Patrick
    Evelyn Patrick Year ago +4

    "Because this is a real programming language, unlike python"

  • pew pew pew
    pew pew pew Year ago +30

    I tried your game... was pretty cool. The mechanics and art was awesome. :D

  • Tommy Sedin
    Tommy Sedin Year ago +763


  • Teh Psychedelic
    Teh Psychedelic Year ago +49

    SDL is also great for homebrew, one of the most ported-out libs out there.

  • Templarfreak
    Templarfreak Year ago +5

    My personal experience with SDL2 in my own projects has been largely positive. I was thinking of ditching it at one point because it seemed like it would ultimately be too high level at the end of the day for my usage, but then I learned a lot of games I know and actually like, such as Don't Starve, actually uses SDL2 and manage to make a very well-performant game so I've redecided on that. :D

  • Khud0 - Indie Game Dev

    This game looks very fun! I wish there was also a reason to move anywhere but forwards (to the right). The first suggestions which come to mind: 1) click (or hold LMB / RMB) above player to duck, 2) long pit, a "bridge platform" for which is located higher than you can jump. Then there'd be some block, walled from the left side, but open from the right side. Jump on it and then on the bridge.

  • Tantan
    Tantan Year ago +152

    Every time I watch someone make a game without a game engine...

  • Calli Meldrum
    Calli Meldrum Year ago +2

    This is really cool :) I've been thinking of trying to start coding games and found this very interesting and inspiring

  • Rugbug Redfern
    Rugbug Redfern Year ago +3

    Looks really good! Awesome work especially considering you made your own engine.

  • Tom Jackson
    Tom Jackson Year ago +1

    A small update I could recommend is adding a random limited spawn of enemies, some that jump, some that fly, some that walk, and some that just stay in place, I believe that would add some difficulty but to counter this you could simply give your little guy a laser that blasts these enemies away, but only shoot straight forward meaning you'll have to jump to hit the flyers. It wouldn't be hard to implement considering you know how to and it would give use to that ghost idea, giving the gloomy background purpose. 10/10 would try it out

  • Mr_kWKD
    Mr_kWKD Year ago +193

    “We have to put semicolons there because this is a real programming language, not python”