diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-11 15:09:21 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-11 15:09:21 +0000 |
commit | af7060d953e1c0f54a7d5bf46894191d41d853ff (patch) | |
tree | e98737c9d15a30e4eade2f63fa97cf65e6b75e72 /src | |
parent | 041c6e3cb599d019d1e92d5087ec6726a5970902 (diff) | |
download | mana-af7060d953e1c0f54a7d5bf46894191d41d853ff.tar.gz mana-af7060d953e1c0f54a7d5bf46894191d41d853ff.tar.bz2 mana-af7060d953e1c0f54a7d5bf46894191d41d853ff.tar.xz mana-af7060d953e1c0f54a7d5bf46894191d41d853ff.zip |
Walk with arrow keys too.
Diffstat (limited to 'src')
-rw-r--r-- | src/being.cpp | 2 | ||||
-rw-r--r-- | src/being.h | 2 | ||||
-rw-r--r-- | src/game.cpp | 8 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/being.cpp b/src/being.cpp index 1344bfbf..625919a2 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -32,7 +32,7 @@ unsigned int count = 0; // Number of beings in the list /** Create a path node */ PATH_NODE::PATH_NODE(unsigned short x, unsigned short y): - next(NULL) + next(NULL) { this->x = x; this->y = y; diff --git a/src/being.h b/src/being.h index 78cffcc4..48cee019 100644 --- a/src/being.h +++ b/src/being.h @@ -63,8 +63,6 @@ struct NODE { void empty(); NODE *get_head(); -//NODE *create_node(); -//PATH_NODE *create_path_node(unsigned short x, unsigned short y); void add_node(NODE *node); NODE *find_node(unsigned int id); void remove_node(unsigned int id); diff --git a/src/game.cpp b/src/game.cpp index 26c99f93..0465cfea 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -162,7 +162,7 @@ void do_input() { int x = get_x(player_node->coordinates); int y = get_y(player_node->coordinates); - if(key[KEY_8_PAD]) { + if(key[KEY_8_PAD] || key[KEY_UP]) { if(get_walk(x, y-1)!=0) { walk(x, y-1, NORTH); walk_status = 1; @@ -172,7 +172,7 @@ void do_input() { player_node->tick_time = tick_time; set_coordinates(player_node->coordinates, x, y-1, NORTH); } else set_coordinates(player_node->coordinates, x, y, NORTH); - } else if(key[KEY_2_PAD]) { + } else if(key[KEY_2_PAD] || key[KEY_DOWN]) { if(get_walk(x, y+1)!=0) { walk(x, y+1, SOUTH); walk_status = 1; @@ -182,7 +182,7 @@ void do_input() { player_node->tick_time = tick_time; set_coordinates(player_node->coordinates, x, y+1, SOUTH); } else set_coordinates(player_node->coordinates, x, y, SOUTH); - } else if(key[KEY_4_PAD]) { + } else if(key[KEY_4_PAD] || key[KEY_LEFT]) { if(get_walk(x-1, y)!=0) { walk(x-1, y, WEST); walk_status = 1; @@ -192,7 +192,7 @@ void do_input() { player_node->tick_time = tick_time; set_coordinates(player_node->coordinates, x-1, y, WEST); } else set_coordinates(player_node->coordinates, x, y, WEST); - } else if(key[KEY_6_PAD]) { + } else if(key[KEY_6_PAD] || key[KEY_RIGHT]) { if(get_walk(x+1, y)!=0) { walk(x+1, y, EAST); walk_status = 1; |