Episode 10 - Reconstructing Cave Story: Jump Sprites and Vertical Facing

2,296 views · Published 16 December 2013 · 38:38 · Indexed 30 September 2026

Channel: Christopher Hebert · 2013 · Education

Watch on YouTube

In this episode we:
 - use jump sprites instead of the standing/walking sprites
 - clean up our sprite map initialization code
 - implement vertical facing (looking up and down)

Note: Iterating over ENUMs (starting around 15:59).
My implementation works in clang++, but not g++, since calling motion_type++ is not valid C++.

Instead, you can use loops of the form:
for (int int_value = ENUM_FIRST; int_value < ENUM_LAST; ++int_value) {
   Enum value = static_cast<Enum>(int_value);
}

The key is that you are incrementing an integer, and not an enum value, and then casting to the enum value.

=================================================
Playlist:
https://www.youtube.com/playlist?list=PL006xsVEsbKjSKBmLu1clo85yLrwjY67X

Content (.bmp files and such):
https://github.com/chebert/cavestory-content/archive/master.zip

Cave Story (freeware version) download page: http://www.cavestory.org/downloads_game.php

More from this channel