-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlevel.h
50 lines (39 loc) · 1.62 KB
/
level.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
#pragma once
#include "defines.h"
#include "vector2d.h"
/* типы объектов уровня */
typedef enum
{
lotNone = 0,
lotBrick = 1,
lotMetalBrick = 2,
lotBlock = 3,
lotCoinBox = 4,
lotMushroomBox = 5,
lotSurpriseBlockUsed = 6
} ELevelObjectType;
/* объект уровня */
typedef struct
{
SVector2f startPos; /* позиция, в которой объект был создан */
SVector2f pos; /* текущая позиция */
SVector2f center; /* центр блока */
ELevelObjectType levelObjectType;
bool isSolid; /* является ли блок твёрдым */
bool isStatic; /* является ли блок подвижным/разбиваемым */
int texIndex;
} SLevelObject;
/* массив из объектов */
SLevelObject* level [LEVEL_HEIGHT][LEVEL_WIDTH];
/* имитация конструктора */
SLevelObject* LevelObjectCreate (ELevelObjectType levelObjectType,
float x, float y,
bool isSolid,
bool isStatic,
int texIndex);
/* имитация деструктора */
void LevelObjectDestroy (SLevelObject** levelObject);
/* загрузка уровня (наполнение массива level) */
void LevelLoad (char* fileName);
void LevelClear ();
void LevelUpdateAndRender ();