Difference between revisions of "Beginner C++ Game Programming Tutorial 21"
(→Notes) |
(→Homework) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
== Notes == | == Notes == | ||
− | Here's an article I found that I like. I like it because it shits in the mouth of multidimensional arrays, which I am no fan of. I maybe wouldn't agree with 100% of what this dude is saying, but it's | + | Here's an article I found that I like. I like it because it shits in the mouth of <code>[][]</code> multidimensional arrays, which I am no fan of. I maybe wouldn't agree with 100% of what this dude is saying, but it's mostly valid points: [http://www.cplusplus.com/forum/articles/17108/ fuck MD arrays forever]. |
− | Also see this discussion here: [http://forum.planetchili.net/viewtopic.php?f=3&t=4011&start=10#p24518 Chili talks about <code> | + | Also see this discussion here: [http://forum.planetchili.net/viewtopic.php?f=3&t=4011&start=10#p24518 Chili talks about <code>[][]</code> arrays]. |
== Video Timestamp Index == | == Video Timestamp Index == | ||
Line 23: | Line 23: | ||
Other good modifications include: not speeding up the Snek over time or when a goal is eaten (the poison is enough for that) and adding a speedup key that can speed the Snek up to a certain speed (but never slower than its current normal speed). | Other good modifications include: not speeding up the Snek over time or when a goal is eaten (the poison is enough for that) and adding a speedup key that can speed the Snek up to a certain speed (but never slower than its current normal speed). | ||
− | The solution to this homework is | + | The solution to this homework is [https://www.youtube.com/edit?o=U&video_id=Vcb_Z2C7Pfc here]. |
== See also == | == See also == |
Latest revision as of 15:24, 12 May 2017
2D arrays are awesome because they fuckin' let us organize or data and shit. Board games like chess, strategy games like Civilization, roguelikes, RTS games, X-Com... it's all grids baby. Also, time to learn how to circular depend our shit with forward declaration (you should still avoid circ. dep. when possible tho).
Contents
Topics Covered
- Mapping from a logical 2D array to a 1D array
- Using forward declaration to enable circular dependency by breaking a circular #include chain
Notes
Here's an article I found that I like. I like it because it shits in the mouth of [][]
multidimensional arrays, which I am no fan of. I maybe wouldn't agree with 100% of what this dude is saying, but it's mostly valid points: fuck MD arrays forever.
Also see this discussion here: Chili talks about [][]
arrays.
Video Timestamp Index
Source Code Download
Homework
The goal for this video's homework is to modify Snek so that the field can contain 3 things (besides the Snek): goals, obstacles, and poison. Hitting an obstacle ends the game. Hitting a goal will grow the Snek and spawn another goal and an obstacle. Hitting a poison will speed the Snek up.
Other good modifications include: not speeding up the Snek over time or when a goal is eaten (the poison is enough for that) and adding a speedup key that can speed the Snek up to a certain speed (but never slower than its current normal speed).
The solution to this homework is here.