-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.h
64 lines (61 loc) · 1.13 KB
/
structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Created by Astori on 17/01/2017.
//
#ifndef NEST_STRUCTS_H
#define NEST_STRUCTS_H
#include "SDL.h"
#include "tmx.h"
typedef struct Sprites
{
SDL_Texture *image;
} Sprites;
typedef struct Entity
{
float x, y, dirX, dirY;
int w, h, onGround, thinkTime, onLadder, collectedCoins, accomplished;
SDL_Texture *sprite_l;
SDL_Texture *sprite_r;
SDL_Texture *sprite_f;
int win;
} Entity;
typedef struct Hud
{
SDL_Texture* Message;
SDL_Surface* surfaceMessage;
SDL_Rect* Message_rect;
int coins;
}Hud;
typedef struct Control
{
int up, down, left, right, jump;
} Control;
typedef struct Map
{
SDL_Texture * gate;
SDL_Texture * water;
SDL_Texture *map_bmp;
tmx_map *map_m;
SDL_Rect *map_rect;
tmx_layer *map_col;
tmx_layer *map_lad;
tmx_layer *map_obj;
tmx_layer *map_door;
Uint32 l_start_ticks;
}Map;
enum
{
PLAYER_SPRITE,
MAX_SPRITES
};
Control input;
Entity* player;
Map* m;
Hud* hud;
#define TILE_SIZE 32
#define SCROLL_SPEED 8
#define GRAVITY_SPEED 0.8
#define MAX_FALL_SPEED 20
#define PLAYER_SPEED 4
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 640
#endif