From b6e7e454ed6242475163dcd534051897d3c9158c Mon Sep 17 00:00:00 2001 From: lamp Date: Sun, 5 Mar 2023 21:25:03 +0000 Subject: init --- include/metasprite.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/metasprite.h (limited to 'include/metasprite.h') diff --git a/include/metasprite.h b/include/metasprite.h new file mode 100644 index 0000000..f4a15e7 --- /dev/null +++ b/include/metasprite.h @@ -0,0 +1,27 @@ +#pragma once +#include + +#include "defines.h" + +typedef struct Metasprite { + ScreenCoordinate x; + ScreenCoordinate y; + UINT8 width; + UINT8 height; + INT8 velocity_x; + INT8 velocity_y; + UINT8 sprite_ids[4]; // A metasprite is four sprites. + UINT8 tile_ids[4]; // A metasprite is four sprites. +} Metasprite; + +inline void metasprite_init(Metasprite *metasprite); +inline void metasprite_move_to(Metasprite *metasprite, ScreenCoordinate new_x, + ScreenCoordinate new_y); +inline void metasprite_move_offset(Metasprite *metasprite, + ScreenCoordinate offset_x, + ScreenCoordinate offset_y); +inline void metasprite_apply_gravity(Metasprite *metasprite); +inline void metasprite_update_position_using_velocity(Metasprite *metasprite); +inline void metasprite_jump(Metasprite *metasprite); +inline void metasprite_update_tiles(Metasprite *metasprite); +inline void metasprite_hide(Metasprite *metasprite); -- cgit v1.2.3