Difference between revisions of "Beginner C++ Game Programming Tutorial 5"
From Chilipedia
(→Solution Errata) |
(→Download Links) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Comparison and Boolean logic operators. Operators galore! Make <code>if</code> statements great again! Let the <code>int</code> dick measuring contests begin! | + | Comparison and Boolean logic operators. Operators galore! Make <code>if</code> statements great again! Let the <code>int</code> dick measuring contests begin! Also, collision detection between rectangles, which is useful for stuff. |
== Concepts Taught == | == Concepts Taught == | ||
Line 5: | Line 5: | ||
* Boolean operators (<code>&&</code>, <code>||</code>, <code>!</code>) | * Boolean operators (<code>&&</code>, <code>||</code>, <code>!</code>) | ||
* Using parentheses to change order of evaluation (effectively changing what an operator works on) | * Using parentheses to change order of evaluation (effectively changing what an operator works on) | ||
+ | * Collision (overlap) detection of rectangular regions (in the homework) | ||
== Video Timestamp Index == | == Video Timestamp Index == | ||
− | + | * Intro [https://www.youtube.com/watch?v=UREKHWvg9ko&t=0m0s 0:00] | |
+ | * A few remarks on drawing pixels outside window bounds [https://www.youtube.com/watch?v=UREKHWvg9ko&t=1m19s 1:19] | ||
+ | * Debug configuration, assertion failures [https://www.youtube.com/watch?v=UREKHWvg9ko&t=2m4s 2:04] | ||
+ | * Comparison operators [https://www.youtube.com/watch?v=UREKHWvg9ko&t=3m11s 3:11] | ||
+ | * Logical operators [https://www.youtube.com/watch?v=UREKHWvg9ko&t=12m41s 12:41] | ||
+ | * Homework [https://www.youtube.com/watch?v=UREKHWvg9ko&t=19m0s 19:00] | ||
== Homework == | == Homework == | ||
Draw two targeting boxes, one controlled with the arrow keys and one stationary, and have the color of the mobile targeting box change whenever the targeting boxes overlap. | Draw two targeting boxes, one controlled with the arrow keys and one stationary, and have the color of the mobile targeting box change whenever the targeting boxes overlap. | ||
− | The solution | + | The solution is given in [https://youtu.be/Uxca1CD5ifk this video]. |
− | === | + | == Download Links == |
− | + | * [https://planetchili.net/downloads/apworks/5/Beginner%20Tutorial%205%20Code.zip Tutorial 5 Code] | |
− | + | * [https://planetchili.net/downloads/apworks/5/Beginner%20Tutorial%205%20HW%20Code.zip Tutorial 5 Homework Solution Code] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
== See also == | == See also == | ||
* [[Beginner C++ Game Programming Tutorial 6|Next in series (Tutorial 6)]] | * [[Beginner C++ Game Programming Tutorial 6|Next in series (Tutorial 6)]] | ||
* [[Beginner C++ Game Programming Series]] | * [[Beginner C++ Game Programming Series]] |
Latest revision as of 12:55, 12 October 2019
Comparison and Boolean logic operators. Operators galore! Make if
statements great again! Let the int
dick measuring contests begin! Also, collision detection between rectangles, which is useful for stuff.
Concepts Taught
- Comparison operators (
>
,<
,==
,>=
,<=
,!=
) - Boolean operators (
&&
,||
,!
) - Using parentheses to change order of evaluation (effectively changing what an operator works on)
- Collision (overlap) detection of rectangular regions (in the homework)
Video Timestamp Index
- Intro 0:00
- A few remarks on drawing pixels outside window bounds 1:19
- Debug configuration, assertion failures 2:04
- Comparison operators 3:11
- Logical operators 12:41
- Homework 19:00
Homework
Draw two targeting boxes, one controlled with the arrow keys and one stationary, and have the color of the mobile targeting box change whenever the targeting boxes overlap.
The solution is given in this video.