Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Learn C++ By Making Games In One Hour!
Rating: 4.0 out of 5(166 ratings)
9,042 students

Learn C++ By Making Games In One Hour!

Create a snake game in C++ from the ground up and learn the power of C++.
Created byDragan Neskovic
Last updated 8/2018
English

What you'll learn

  • Be able to understand C++ and it's logic.

Course content

1 section15 lectures1h 12m total length
  • Introduction6:51
  • If Statement3:49

    Learn how to initialize two integer variables, read input, and display their sum, then use an if statement to output the larger number between A and B.

  • For Loop3:32

    Explore how the for loop repeats code from a starting value to an ending value, using initialization and i++, with examples from 1 to 5 and 0 to 4.

  • Game Functions4:07

    Initialize a global boolean game over and four void functions—settings, visual, input, and logic—to run a loop that draws the arena and handles input until game over is true.

  • Player Movement and Direction7:25

    Set up global variables for player and fruit positions in a 20 by 20 arena, using x and y coordinates, plus a stop state and direction enum to control movement.

  • Arena Design7:09

    Design arena by clearing the console and drawing a 20 by 20 border with hashtags using nested loops for walls, and plan to slow the game to reduce blinky visuals.

  • Healthy Game Adjustments3:26

    Learn to stabilize a console game by fixing missing tiles, slow the game with sleep for 10 seconds, and ensure random works on older compilers while refining arena and sidewalls.

  • Player Appearance3:10

    This lecture covers spawning fruit and players in a loop, placing the player at the arena center, and prepping for random fruit placement and movement with an input library.

  • Player Input and Controls4:29
  • Game Logic4:27

    Implement character movement using a switch for left, right, up, and down, updating the x and y coordinates with x minus minus and x plus plus.

  • Fruit and Score Incrementation3:26
  • Wall Passing Logic5:10

    Wrap the snake’s x and y coordinates at the screen edges to create wall passing. Introduce tail tracking so the tail follows the head and grows when fruits are eaten.

  • Snake Tail Logic7:06

    Implement snake tail logic by tracking previous x and y coordinates for each tail segment and updating the tail with a for loop so it follows as fruits are eaten.

  • Tail Visualities4:53
  • Game Finalization3:43

    Finalize the snake game by implementing collision detection: loop through snake segments and set game over when the head matches a segment, using for loops and if statements in C++.

Requirements

  • Visual Studio

Description

C++ is a general purpose programming language, it can be very difficult and tedious to learn, that is why we will learn it through game development!


We will learn the most important aspects of C++ programming and once we're comfortable enough we will dig deeper and create a snake game using only the power of C++.


Who this course is for:

  • Beginner C++ developers interested in game development and design.