From ba830f93a15299fd578b00969eff3c403456950c Mon Sep 17 00:00:00 2001 From: UnavailableDev Date: Fri, 24 Mar 2023 20:20:44 +0100 Subject: added first pass on animation systems --- src/engine/types.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/engine/types.h (limited to 'src/engine/types.h') diff --git a/src/engine/types.h b/src/engine/types.h new file mode 100644 index 0000000..241d706 --- /dev/null +++ b/src/engine/types.h @@ -0,0 +1,42 @@ +#pragma once + +#include "engine/maths.h" + +typedef uint8_t hh_idx_t; + +typedef enum { + fire, ice, poison +}hh_e_damage_t; + + +typedef struct { + int8_t hp; + int8_t dmg; + hh_e_damage_t dmg_type; + int8_t speed_x, speed_y; + +} hh_s_atributes; + + +typedef struct { + hh_s_ppu_loc_fam_entry fam; //screen + hh_idx_t frame0; + hh_idx_t palette; + +}hh_s_rendering; + +typedef struct { + vec2 pos, vel, size; + bool is_grounded; + bool is_hit; + uint8_t radius; + int8_t hp; + int8_t speed; + hh_s_rendering render; + +}hh_entity; + +typedef struct { + hh_entity p; + hh_s_atributes atr; +}hh_s_player; -- cgit v1.2.3 From 7373a9529659d4591e9fd921ef3a4771ec378965 Mon Sep 17 00:00:00 2001 From: UnavailableDev Date: Mon, 3 Apr 2023 10:04:54 +0200 Subject: misc/cleanup --- src/engine/bullet.c | 2 +- src/engine/draw_screen.c | 6 ++++++ src/engine/types.h | 8 +++++--- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/engine/types.h') diff --git a/src/engine/bullet.c b/src/engine/bullet.c index 5aa9e51..b97ed5c 100644 --- a/src/engine/bullet.c +++ b/src/engine/bullet.c @@ -22,7 +22,7 @@ void updateBullet(Bullet* bullet, int deltaTime){ if (bullet->x - latestLocationBullet > 32) { // Set bullet's status to inactive bullet->isActive = false; - drawBullet(&(Bullet){.x = -16,.y = -16. }); + drawBullet(&(Bullet){.x = -16,.y = -16}); } } else{ diff --git a/src/engine/draw_screen.c b/src/engine/draw_screen.c index 0c31bf6..a34a20b 100644 --- a/src/engine/draw_screen.c +++ b/src/engine/draw_screen.c @@ -1,6 +1,12 @@ #include "engine/draw_screen.h" #include "engine/sprite_controller.h" +static struct draw_screen +{ + void* levels[12] +}; + + uint8_t hh_world_to_tile(vec2 pos){ //TODO: remove magic file name here FILE* level = fopen("static/level1_test.bin", "rb"); /* open binary file */ diff --git a/src/engine/types.h b/src/engine/types.h index 241d706..00b381b 100644 --- a/src/engine/types.h +++ b/src/engine/types.h @@ -2,7 +2,8 @@ #include "engine/maths.h" -typedef uint8_t hh_idx_t; +typedef uint8_t hh_ppu_fg_idx; +// typedef uint16_t hh_bg_idx; typedef enum { fire, ice, poison @@ -20,8 +21,9 @@ typedef struct { typedef struct { hh_s_ppu_loc_fam_entry fam; //screen - hh_idx_t frame0; - hh_idx_t palette; + uint16_t frame0; + uint16_t palette; + uint16_t ppu_foreground_index; }hh_s_rendering; -- cgit v1.2.3