From 2fbdf974338bde8576efdae40a819a76b2391033 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 5 Nov 2023 11:22:55 +0000 Subject: Initial import of the open source release --- src/et_player.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/et_player.h (limited to 'src/et_player.h') 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 + + 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 . + */ +#ifndef _PLAYER_H +#define _PLAYER_H + +#include + +#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 + -- cgit v1.2.3