-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlevel.h
60 lines (42 loc) · 1.71 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
51
52
53
54
55
56
57
58
59
60
#pragma once
#ifndef LEVEL_H
#define LEVEL_H
#include "chipmunk/chipmunk_private.h"
#include "defines.h"
#include "list.h"
#include "tileObject.h"
// типы объектов уровня
typedef enum
{
lotNone = 0,
/* статичные блоки*/
lotBlock, // квадратный
lotBlockLeftToUp, // треугольник - подъем слева вверх
lotBlockRightToUp, // треугольник - подъем справа вверх
lotBlockTrasparentDown // блок, на который можно запрыгнуть снизу насквозь
} ELevelObjectType;
// объект уровня
typedef struct
{
//cpVect startPos; // позиция, в которой объект был создан
cpVect pos; // текущая позиция
ELevelObjectType levelObjectType;
cpBody* body;
cpShape* shape;
//int texIndex;
} SLevelObject;
SLevelObject* level [LEVEL_HEIGHT][LEVEL_WIDTH];
// имитация конструктора
SLevelObject* LevelObjectCreate (cpSpace* space,
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 ();
#endif // LEVEL_H