34 lines
661 B
C
34 lines
661 B
C
#ifndef SPRITE_H_
|
|
#define SPRITE_H_
|
|
|
|
#include "./vec.h"
|
|
#include "./map.h"
|
|
|
|
typedef struct SpriteCorners {
|
|
UVec itl;
|
|
UVec itr;
|
|
UVec ibl;
|
|
UVec ibr;
|
|
} SpriteCorners;
|
|
|
|
typedef struct Sprites {
|
|
int frames_since_last_dash;
|
|
int frames_since_last_jump;
|
|
int bitmap_index;
|
|
int bitmap_indexes[8];
|
|
int bitmap_prop[8];
|
|
int has_diag_sprites;
|
|
int has_joypad;
|
|
char name[20];
|
|
SpriteCorners collision_offset[8];
|
|
UVec pos;
|
|
Vec vel;
|
|
Vec acc;
|
|
} Sprite;
|
|
|
|
void sprite_iter_frame(Sprite *sprite, Map *map, int joypad, unsigned int *fc);
|
|
unsigned int sprite_internal_collision(Map *map, Sprite *sprite);
|
|
unsigned int sprite_collision(Map *map, Sprite *sprite);
|
|
|
|
#endif
|