Beginner C++ Game Programming Tutorial 10

From Chilipedia
Jump to: navigation, search

In this video we learn how to loop our shit. Fuckoff copy and paste. Die in a gasoline fire (just kidding, don't leave me baby!)

Concepts Taught

  • while loop
  • for loop
  • do ... while loop
  • Preincrement ++x and postincrement x++ operators

Video Timestamp Index

  • Intro 0:00
  • The roadmap 0:20
  • Loops: while() {...} 1:39
  • Loops: for() {...} 8:20
  • Increment/decrement unary operator 10:51
  • Fun Chili fact for the day: the origins of the "C++" language name 11:51
  • Loops: do {...} while () 12:36
  • Loop differences, when to use for(){}, while(){}, or do{} while() (if you are kinda weird) 13:15
  • Chili's Dank Meta Nugs 15:06
  • Homework 18:23

Homework

  1. Write a routine to draw a rectangle on the screen.
  2. Make it so that you can control the position of the rectangle with the arrow keys and the size of the rectangle with the WASD keys. For info on querying keyboard input for alphanumeric keys, see the section "Virtual Key Codes" on this page.

The solution is given in a this video.

Downloads

See also