Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/CPZ/Spiny.h
338 views
1
#ifndef OBJ_SPINY_H
2
#define OBJ_SPINY_H
3
4
#include "Game.h"
5
6
typedef enum {
7
SPINY_FLOOR,
8
SPINY_WALL,
9
} SpinyTypes;
10
11
// Object Class
12
struct ObjectSpiny {
13
RSDK_OBJECT
14
Hitbox hitboxSpiny;
15
Hitbox hitboxRange;
16
Hitbox hitboxShot;
17
uint16 aniFrames;
18
uint16 sfxShot;
19
};
20
21
// Entity Class
22
struct EntitySpiny {
23
RSDK_ENTITY
24
StateMachine(state);
25
Animator animator;
26
int32 unused;
27
uint8 type;
28
Vector2 startPos;
29
uint8 startDir;
30
int32 shotVelocity;
31
int32 dirChangeTimer;
32
int32 moveTimer;
33
};
34
35
// Object Struct
36
extern ObjectSpiny *Spiny;
37
38
// Standard Entity Events
39
void Spiny_Update(void);
40
void Spiny_LateUpdate(void);
41
void Spiny_StaticUpdate(void);
42
void Spiny_Draw(void);
43
void Spiny_Create(void *data);
44
void Spiny_StageLoad(void);
45
#if GAME_INCLUDE_EDITOR
46
void Spiny_EditorDraw(void);
47
void Spiny_EditorLoad(void);
48
#endif
49
void Spiny_Serialize(void);
50
51
// Extra Entity Functions
52
void Spiny_DebugSpawn(void);
53
void Spiny_DebugDraw(void);
54
55
void Spiny_CheckPlayerCollisions(void);
56
void Spiny_CheckOffScreen(void);
57
58
void Spiny_State_Init(void);
59
void Spiny_State_Floor(void);
60
void Spiny_State_Shoot_Floor(void);
61
void Spiny_State_Wall(void);
62
void Spiny_State_Shoot_Wall(void);
63
64
void Spiny_State_Shot(void);
65
void Spiny_State_ShotDisappear(void);
66
67
#endif //! OBJ_SPINY_H
68
69