#include <vector>
enum {
- LEVEL_LINE_COUNT = 13
+ LEVEL_LINE_COUNT = 14
};
+#define PATH_PREFIX "../badge/jumpnrun/"
+
namespace jnrcpp {
struct descriptors {
descriptors() {
("tube_right" , JUMPNRUN_TILE_TYPE_TUBE_RIGHT )
("brick" , JUMPNRUN_TILE_TYPE_BRICK )
("square" , JUMPNRUN_TILE_TYPE_SQUARE )
+ ("spike_up" , JUMPNRUN_TILE_TYPE_SPIKE_UP )
+ ("spike_right" , JUMPNRUN_TILE_TYPE_SPIKE_RIGHT )
+ ("spike_down" , JUMPNRUN_TILE_TYPE_SPIKE_DOWN )
+ ("spike_left" , JUMPNRUN_TILE_TYPE_SPIKE_LEFT )
;
items.add
;
enemies.add
- ("cat" , JUMPNRUN_ENEMY_TYPE_CAT )
- ("mushroom" , JUMPNRUN_ENEMY_TYPE_MUSHROOM )
- ("kaninchen", JUMPNRUN_ENEMY_TYPE_KANINCHEN)
+ ("cat" , JUMPNRUN_ENEMY_TYPE_CAT )
+ ("mushroom" , JUMPNRUN_ENEMY_TYPE_MUSHROOM )
+ ("bunny" , JUMPNRUN_ENEMY_TYPE_BUNNY )
+ ("kaninchen" , JUMPNRUN_ENEMY_TYPE_BUNNY ) // legacy
+ ("snake" , JUMPNRUN_ENEMY_TYPE_SNAKE )
+ ("spiral" , JUMPNRUN_ENEMY_TYPE_SPIRAL )
+ ("rotor" , JUMPNRUN_ENEMY_TYPE_ROTOR )
+ ("dog" , JUMPNRUN_ENEMY_TYPE_DOG )
+ ("giraffe" , JUMPNRUN_ENEMY_TYPE_GIRAFFE )
+ ("bird" , JUMPNRUN_ENEMY_TYPE_BIRD )
+ ("bird_straight", JUMPNRUN_ENEMY_TYPE_BIRD_STRAIGHT)
+ ("bird_dip" , JUMPNRUN_ENEMY_TYPE_BIRD_DIP )
;
}
struct level_name_map {
level_name_map() {
- std::ifstream in("jumpnrun/levels.txt");
+ std::ifstream in(PATH_PREFIX "levels.txt");
if(!in) {
- throw std::logic_error("jumpnrun/levels.txt konnte nicht geöffnet werden.");
+ throw std::logic_error(PATH_PREFIX "levels.txt konnte nicht geöffnet werden.");
}
std::string name;
: name(name),
level_lines(LEVEL_LINE_COUNT)
{
- std::ifstream in(("jumpnrun/" + name + ".lv").c_str());
+ std::ifstream in((PATH_PREFIX + name + ".lv").c_str());
if(!in) {
throw std::invalid_argument("Could not open file: " + name + ".lv");
void jumpnrun_level_dump(size_t level) {
std::string name = jnrcpp::level_names.names[level];
jnrcpp::level lv(name);
- std::ofstream out(("jumpnrun/" + name + ".lvl").c_str());
+ std::ofstream out((PATH_PREFIX + name + ".lvl").c_str());
lv.dump(out);
}