Difference between revisions of "Beginner C++ Game Programming Tutorial 3"

From Chilipedia
Jump to: navigation, search
(Concepts Taught)
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
We learn how to control the flow of execution using <code>if</code> statements, we learn about a new [[variable]] type called [[variable#bool|<code>bool</code>]], and we learn how to use the [[Chili Framework]] to get [[Keyboard (Chili Framework)|keyboard]] input. All this, plus the dankest memes from 2007.
+
We learn how to control the flow of execution using [[If Statement|<code>if</code> statements]], we learn about a new [[variable]] type called [[variable#bool|<code>bool</code>]], and we learn how to use the [[Chili Framework]] to get [[Keyboard (Chili Framework)|keyboard]] input. All this, plus the dankest memes from 2007.
  
 
== Concepts Taught ==
 
== Concepts Taught ==
* <code>if</code> statement
+
* [[If_Statement|<code>if</code> statement]]
 
* [[variable#bool|<code>bool</code>]] variable type
 
* [[variable#bool|<code>bool</code>]] variable type
 
* Using return values from function calls
 
* Using return values from function calls
Line 23: Line 23:
  
 
== Homework ==
 
== Homework ==
Using the concepts taught so far, create a program that allows you to position the reticle in one of 9 positions (regular 3x3 grid) by holding the arrow keys, change its color by holding the control key, and change its shape by holding the shift key. The solution is given at the beginning of Tutorial 4.
+
Using the concepts taught so far, create a program that allows you to position the reticle in one of 9 positions (regular 3x3 grid) by holding the arrow keys, change its color by holding the control key, and change its shape by holding the shift key. The solution is given in [https://youtu.be/lTSaoRYo430 this video].
  
 
== See also ==
 
== See also ==
 
* [[Beginner C++ Game Programming Tutorial 4|Next in series (Tutorial 4)]]
 
* [[Beginner C++ Game Programming Tutorial 4|Next in series (Tutorial 4)]]
 
* [[Beginner C++ Game Programming Series]]
 
* [[Beginner C++ Game Programming Series]]

Revision as of 22:16, 17 June 2018

We learn how to control the flow of execution using if statements, we learn about a new variable type called bool, and we learn how to use the Chili Framework to get keyboard input. All this, plus the dankest memes from 2007.

Concepts Taught

Video Timestamp Index

  • Intro 0:00
  • Homework solution 0:29
  • Sprite origin (base position) 1:30
  • Order of statement execution 5:10
  • Branching (conditional flow control) 6:40
  • if statement / bool type 7:52
  • Keyboard input / objects inside other objects 12:06
  • Function return values 15:55
  • Virtual key codes 17:27
  • if ... else statement 19:33
  • if ... else if chaining 20:35
  • Nesting if statements 22:05
  • Homework assignment 23:48

Homework

Using the concepts taught so far, create a program that allows you to position the reticle in one of 9 positions (regular 3x3 grid) by holding the arrow keys, change its color by holding the control key, and change its shape by holding the shift key. The solution is given in this video.

See also