40 lines
627 B
C
40 lines
627 B
C
#pragma once
|
|
|
|
#define PLAYER_SIZE 16
|
|
|
|
#define LEVEL_W 25
|
|
#define LEVEL_H 14
|
|
#define LEVEL_S LEVEL_W * LEVEL_H
|
|
|
|
#define TILE_S 16
|
|
#define TILESET_W 1
|
|
#define TILESET_H 1
|
|
|
|
/* Yup, it's exactly the code from frozen frenzy™. */
|
|
|
|
/* struct for a pair of int values */
|
|
typedef struct Vec2 {
|
|
int x, y;
|
|
} Vec2;
|
|
|
|
/* struct for a pair of float values */
|
|
typedef struct FVec2 {
|
|
float x, y;
|
|
} FVec2;
|
|
|
|
/* struct for player's data */
|
|
typedef struct Player {
|
|
Vec2 pos;
|
|
Vec2 spawn;
|
|
FVec2 spd;
|
|
} Player;
|
|
|
|
/* dynamic level data */
|
|
typedef struct Level {
|
|
int width, height;
|
|
int data[];
|
|
} Level;
|
|
|
|
/* used for tiles */
|
|
typedef int tile_t;
|