Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/CPZ/Ball.h
338 views
1
#ifndef OBJ_BALL_H
2
#define OBJ_BALL_H
3
4
#include "Game.h"
5
6
typedef enum {
7
BALL_SINGLE,
8
BALL_SPAWN_LEFT,
9
BALL_SPAWN_UP,
10
BALL_SPAWN_RIGHT,
11
BALL_SPAWN_DOWN,
12
} BallTypes;
13
14
// Object Class
15
struct ObjectBall {
16
RSDK_OBJECT
17
Hitbox hitboxBall;
18
Hitbox hitboxRange;
19
uint16 aniFrames;
20
uint16 sfxSplash;
21
};
22
23
// Entity Class
24
struct EntityBall {
25
RSDK_ENTITY
26
StateMachine(state);
27
uint8 type;
28
EntityPlayer *targetPlayer;
29
Vector2 startPos;
30
Animator animator;
31
};
32
33
// Object Entity
34
extern ObjectBall *Ball;
35
36
// Standard Entity Events
37
void Ball_Update(void);
38
void Ball_LateUpdate(void);
39
void Ball_StaticUpdate(void);
40
void Ball_Draw(void);
41
void Ball_Create(void *data);
42
void Ball_StageLoad(void);
43
#if GAME_INCLUDE_EDITOR
44
void Ball_EditorDraw(void);
45
void Ball_EditorLoad(void);
46
#endif
47
void Ball_Serialize(void);
48
49
// Extra Entity Functions
50
void Ball_DebugSpawn(void);
51
void Ball_DebugDraw(void);
52
53
void Ball_HandleInteractions(void);
54
void Ball_CheckOffScreen(void);
55
void Ball_SpawnSplashes(void);
56
57
void Ball_State_Init(void);
58
void Ball_State_AwaitPlayer(void);
59
void Ball_State_TargetingPlayer(void);
60
void Ball_State_ChemicalDrop(void);
61
void Ball_State_Splash(void);
62
void Ball_State_StraightMovement(void);
63
void Ball_State_Spawner(void);
64
65
#endif //! OBJ_BALL_H
66
67