diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-11-05 11:22:55 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-11-05 11:31:28 +0000 |
commit | 2fbdf974338bde8576efdae40a819a76b2391033 (patch) | |
tree | 64d41a37470143f142344f9a439d96de3e7918c2 /src/et_player.h | |
download | kitsunes-curse-2fbdf974338bde8576efdae40a819a76b2391033.tar.gz kitsunes-curse-2fbdf974338bde8576efdae40a819a76b2391033.zip |
Initial import of the open source release
Diffstat (limited to 'src/et_player.h')
-rw-r--r-- | src/et_player.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/et_player.h b/src/et_player.h new file mode 100644 index 0000000..a72aa28 --- /dev/null +++ b/src/et_player.h @@ -0,0 +1,65 @@ +/* + Kitsune's Curse + Copyright (C) 2020-2023 Juan J. Martinez <jjm@usebox.net> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + */ +#ifndef _PLAYER_H +#define _PLAYER_H + +#include <stdint.h> + +#define WALK 0 +#define WALK_CYCLE 3 +#define CROUCH 4 +#define JUMP 5 + +#define DIR_RIGHT 0 +#define DIR_LEFT 1 +#define DIR_DOWN 2 +#define DIR_UP 3 + +#ifndef LOCAL +#define LOCAL extern +extern const uint8_t player_frames[]; +extern const uint8_t jump_seq[]; +#else +const uint8_t player_frames[6] = { 1, 0, 1, 2, 3, 3 }; +const uint8_t jump_seq[8] = { 14, 12, 4, 2, 0, 4, 8, 12 }; +#endif + +#define JUMP_SEQ 8 +#define IS_GOING_DOWN(x) ((x) > 5) + + +#define COOL_DOWN 10 +#define RESPAWN_DELAY 16 +#define WAS_HIT 24 +#define GAMEOVER_DELAY 48 + +#define MAX_LIFE 5 + +void player_checkpoint(); + +void draw_player(); +void update_player(); + +void player_hit(uint8_t h); + +uint8_t check_for_player(uint8_t h) __z88dk_fastcall; + +#undef LOCAL + +#endif // _PLAYER_H + |