Difference between revisions of "Beginner C++ Game Programming Tutorial 22"
From Chilipedia
(Created page with "We learn how to use enum to get rid of all the magic number bullshit for representing a number of options or states, and we learn how to use switch/case as an alternative to l...") |
(→Homework) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | We learn how to use enum to get rid of all the magic number bullshit for representing a number of options or states, and we learn how to use switch/case as an alternative to long if ... else chains. I also give the sermon on the mount (c:). | + | We learn how to use <code>enum</code> to get rid of all the magic number bullshit for representing a number of options or states, and we learn how to use <code>switch</code>/<code>case</code> as an alternative to long <code>if</code> ... <code>else</code> chains. I also give the sermon on the mount (c:). |
== Topics Covered == | == Topics Covered == | ||
− | * Declaring and using enum class | + | * Declaring and using <code>enum class</code> |
− | * Writing a switch statement | + | * Writing a <code>switch</code> statement |
* The evils of premature eja... optimization | * The evils of premature eja... optimization | ||
− | |||
== Video Timestamp Index == | == Video Timestamp Index == | ||
− | [https://youtu.be/ | + | [https://youtu.be/ZsUTOv5Kf8Q Tutorial 22] |
== Source Code Download == | == Source Code Download == | ||
− | [https://github.com/planetchili/snek Snek Repository] | + | [https://github.com/planetchili/snek Snek Repository]<br /> |
[https://github.com/planetchili/Fart-Annoyed Fart-Annoyed Repository] | [https://github.com/planetchili/Fart-Annoyed Fart-Annoyed Repository] | ||
Line 18: | Line 17: | ||
The goal for this video's homework is to modify apply the concepts learned in this tutorial to Fart-Annoyed. | The goal for this video's homework is to modify apply the concepts learned in this tutorial to Fart-Annoyed. | ||
− | The solution to this homework is | + | The solution to this homework is [https://www.youtube.com/watch?v=lrCMMTGHaKU here]. |
== See also == | == See also == |
Latest revision as of 12:35, 18 May 2017
We learn how to use enum
to get rid of all the magic number bullshit for representing a number of options or states, and we learn how to use switch
/case
as an alternative to long if
... else
chains. I also give the sermon on the mount (c:).
Topics Covered
- Declaring and using
enum class
- Writing a
switch
statement - The evils of premature eja... optimization
Video Timestamp Index
Source Code Download
Snek Repository
Fart-Annoyed Repository
Homework
The goal for this video's homework is to modify apply the concepts learned in this tutorial to Fart-Annoyed.
The solution to this homework is here.