Difference between revisions of "Intermediate C++ Game Programming Tutorial 12"
From Chilipedia
(→Video Timestamp Index) |
(→Video Timestamp Index) |
||
Line 14: | Line 14: | ||
* Implementing the <code>Animation</code> class [https://youtu.be/KXn7-5zg3J4?t=3m30s 3:30], constructor implementation at [https://youtu.be/KXn7-5zg3J4?t=5m15s 5:15] | * Implementing the <code>Animation</code> class [https://youtu.be/KXn7-5zg3J4?t=3m30s 3:30], constructor implementation at [https://youtu.be/KXn7-5zg3J4?t=5m15s 5:15] | ||
* Copy the FrameTimer class used in earlier tutorials [https://youtu.be/KXn7-5zg3J4?t=7m35s 7:35] | * Copy the FrameTimer class used in earlier tutorials [https://youtu.be/KXn7-5zg3J4?t=7m35s 7:35] | ||
+ | * Give it a test run: have an animated sprite follow the cursor [https://youtu.be/KXn7-5zg3J4?t=8m00s 8:00] | ||
== Source Code == | == Source Code == |
Revision as of 03:28, 9 September 2019
In this tutorial Chili shows us an example of how to create a class for an animated sprite, and how to use a collection of these animated sprites to create a walking character class.
Contents
Topics Covered
- Animated sprite class design
- Walking character class design
Notes
The technique we use of storing a reference to Surface
in each Animation
object will work for now, but it will cause us a pain in the dick in the future when we start using our characters in containers like std::vector
. The reason for this is because you cannot assign a reference to refer something else after it has been bound, and so the compiler cannot generate copy assign for us by default. We will fix this problem when it becomes an issue for us (in the Action RPG Project).
Video Timestamp Index
- Introducing the
Character
andAnimation
classes 0:20 - Creating header file for the
Animation
class 0:49 - Implementing the
Animation
class 3:30, constructor implementation at 5:15 - Copy the FrameTimer class used in earlier tutorials 7:35
- Give it a test run: have an animated sprite follow the cursor 8:00
Source Code
Download Materials
Homework
None!