Unreal Engine Tutorial – Create a 2D Snake Game [Code + Assets]



Learn how to create a 2D Snake Game with Unreal Engine in this full tutorial. In this beginner’s course, you will how to create a game with Unreal Engine and Blueprints.

💻 Project assets: https://drive.google.com/file/d/1sd9LkLQ4z6Q0CaoBsL94yFo_zW0E0fWa/view?usp=sharing
💻 Completed project: https://drive.google.com/file/d/1CcYTmVbMl4Feoyt8QNknCajJQfEYYSfo/view?usp=sharing

🎥 Course from Awesome Tuts. Check out their YouTube channel: https://www.youtube.com/awesometuts

🔗 Learn more about game development here: https://www.awesometuts.com/ultimate-game-dev-academy?utm_medium=youtube&utm_source=freecodecamp

Learn to code for free and get a developer job: https://www.freecodecamp.org

Read hundreds of articles on programming: https://freecodecamp.org/news

And subscribe for new videos on technology every day: https://youtube.com/subscription_center?add_user=freecodecamp

source

This Post Has 42 Comments

  1. bibek saha

    Please make a tutorial on making games for android phones

  2. Jefferson Sahn

    Unrelated to unreal engine: please if anyone can explain to me why is that whenever I spend 15 and above minutes in Unity my MacBook over heat?
    What can I do to solve this issue?

  3. name name

    Come one who use unreal engine plz make a unity video unity is the best

  4. ايمان

    سبحان الله ويحمده
    سبحان الله العظيم

  5. Ben

    I remembered create this snake games with c++. I am expecting more to get me excited to learn unreal engine.

  6. Andrew Chen

    This is a tutorial I never imagined… But I love it! Thank you!

  7. Ben Brooker

    Anyone have any advice for a university student (Economics – can't switch to CompSci) wanting an internship as a back-end software engineer?
    Have 2 years left at uni and i've been teaching myself code in my spare time. I can currently work with Java, Python, R, SQL and do not have any relevent work experience. Should I freelance, learn more languages, join hackathons etc.. ? Cheers!

  8. Mario Luigi

    I hope I can use WASD Q/E to navigate into blueprint editor.

  9. iiiT1M3Diii

    Does anyone know why I would be getting the following error: Blueprint Runtime Error: "Accessed None trying to read property CallFunc_Array_Get_Item_10". Blueprint: BP_MainGame Function: Execute Ubergraph BP Main Game Graph: Move Snake Node: SetActorLocation ?

    I followed the video exactly (or at least I think I did) but have no idea how to fix this issue. Everything spawns but I cannot move the Snake.

  10. J Money

    i just ran through this tutorial and i had a question. why am i getting an error for "Attempted to access BPFood via property FoodActorRef, but BPFood_C_0 is pending kill"? I'm unsure what i did wrong here. A little help? Also, i really dig the tutorial!

  11. sumedh mahajan

    @Awesome Tuts which version to download of unreal engine , where to download?

  12. Ethan Dsouza

    For that grey circle in the middle you would need to hide the BP_MainGame actor in game, can be done from the details panel with the Blueprint selected

  13. Liang Men

    so clearly explained every step, nice tutorial

  14. Liang Men

    The blackish dot in the centre is the "defaultPawn", which you can see it in the World Outliner in play mode. It is automatically added into the scene because this Snake Game does not use any pawns. An easy way to solve this is to add a pawn, double click the pawn, set "auto possess player" to player 0, and then add it to the scene.

  15. Feel OK

    2:25:18
    Can someone explain how "Is Head" boolean work. Cant understand how it check if it is head or not and when it change from Fasle to True and backward.

  16. Feel OK

    2:29:21
    You can add delay before closing gate to improve your snake movement.

    It wil be smth like that:

    "Input Up/Down/Left/Right"
    "Pressed" —> "Open" (open gate just like in tutorial)
    "Released" —> "Delay" (function)
    "Completed" —> "Close" (close gate)
    "get Delay" (variable) —> duration (attach to delay function duration)

    Now when u press button snake wil definetly do what you want))

  17. Feel OK

    Sometimes food spawn behind snake body

  18. GP

    1080p please….

  19. Jordan H

    Has anyone found a solution to completely rid the input delay?

  20. Unknown

    Can someone help me, the snake doesn’t destroy the food and doesn’t add score when it hits it.

  21. Danielle Dennis

    Heya

    I have done exactly and double checked that it was just as you had it in the video but I have two problems. The grey square sprite is smaller than the brick border so the border is not actually touching the sprite. It looks like a box within a border.

    2. After giving the snake movement I can no longer see the snake head.

    What do I do to fix?

  22. Mariam Shmaysem

    Hi
    How to change this game 'key' controls to be 'touch' controls ??

  23. Zane Martini

    Got thsi error while compiling and saving "Kill Snake" 1:06:20 :-
    the property associated with paper flipbook could not be found in '/game/blueprints/bp_maingame.bp_maingame_c'
    if anyone could help.

  24. My dear Sam

    Is this intended for someone familiar with the topic? This is titled "beginner" and should have included steps for installing Unreal Editor, plus highlighting some prerequisites.

  25. I already did this course twice – however I do not receive any keyboard events. The game runs but it neither accept the arrow keys nor the 'R' key. Any ideas about that?

Leave a Reply