-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphysics.h
72 lines (60 loc) · 2.07 KB
/
physics.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
65
66
67
68
69
70
71
72
/*
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
Alternatively, the contents of this file may be used under the terms
of the GNU Lesser General Public license (the "LGPL License"), in which case the
provisions of LGPL License are applicable instead of those
above.
For feedback and questions about our Files and Projects please mail us,
Janek Schäfer (foxblock) , foxblock_gmail_com
Alexander Matthes (Ziz) , zizsdl_at_googlemail.com
*/
#ifndef _PHYSIC_H
#define _PHYSIC_H
#include <sparrow3d.h>
#include "global_defines.h"
typedef struct sPhysicsElement *pPhysicsElement;
#include "level.h"
typedef struct sPhysicsElement {
//constant stuff
Sint32 w,h; //32 pixel == SP_ONE
int permeability; //bit,direction: 1,left 2,top 4,right 8,down (15 means solid, 0 transparent
int floating;
int moveable;
int platform;
int background;
int mover;
int is_static;
LevelObjectType type;
pLevelObject levelObject;
pPhysicsElement prev,next;
//stuff, which changes
struct {Sint32 x,y;} position,speed;
int freeFallCounter;
int had_collision;
int had_collision_with_choosen_player;
int platform_enabled;
int paterNoster_is_on;
struct {
int in_jump;
int can_jump;
int last_run;
int pushes;
int uses_stuff;
} player;
} tPhysicsElement;
pPhysicsElement createPhysicsElement(Sint32 x,Sint32 y,Sint32 w,Sint32 h,
int permeability,int floating,int moveable,int platform,int background, int mover,pLevelObject levelObject, int static_);
void createPhysicsFromLevel(pLevel level);
void clearPhysics(); //Deletes the whole scene
void doPhysics(pLevel level);
void updateLevelObjects();
pPhysicsElement getFirstMoveableElement();
int getCollisionCount(); //DEBUG
#endif