Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/UFO/UFO_Sphere.h
338 views
1
#ifndef OBJ_UFO_SPHERE_H
2
#define OBJ_UFO_SPHERE_H
3
4
#include "Game.h"
5
6
typedef enum {
7
UFO_SPHERE_BLUE,
8
UFO_SPHERE_RED,
9
UFO_SPHERE_MINE,
10
UFO_SPHERE_SPIKES,
11
} UFO_SphereTypes;
12
13
typedef enum {
14
UFO_SPHERE_B_NONE,
15
UFO_SPHERE_B_BOUNCE,
16
UFO_SPHERE_B_MOVE,
17
} UFO_SphereBehaviours;
18
19
// Object Class
20
struct ObjectUFO_Sphere {
21
RSDK_OBJECT
22
int32 unused;
23
TABLE(int32 defaultHeights[4], { 12, 12, 16, 16 });
24
uint16 aniFrames;
25
uint16 sfxMachSpeed;
26
uint16 sfxLedgeBreak;
27
};
28
29
// Entity Class
30
struct EntityUFO_Sphere {
31
RSDK_ENTITY
32
StateMachine(state);
33
int32 type;
34
int32 behavior;
35
int32 height;
36
int32 speed;
37
Vector2 matAngle;
38
Vector2 amplitude;
39
int32 timer;
40
int32 startHeight;
41
Vector2 startPos;
42
Vector2 worldPos;
43
Vector2 drawPos;
44
int32 scaleFactor;
45
Matrix matrix;
46
Matrix matrix2;
47
Animator animator;
48
};
49
50
// Object Struct
51
extern ObjectUFO_Sphere *UFO_Sphere;
52
53
// Standard Entity Events
54
void UFO_Sphere_Update(void);
55
void UFO_Sphere_LateUpdate(void);
56
void UFO_Sphere_StaticUpdate(void);
57
void UFO_Sphere_Draw(void);
58
void UFO_Sphere_Create(void *data);
59
void UFO_Sphere_StageLoad(void);
60
#if GAME_INCLUDE_EDITOR
61
void UFO_Sphere_EditorDraw(void);
62
void UFO_Sphere_EditorLoad(void);
63
#endif
64
void UFO_Sphere_Serialize(void);
65
66
// Extra Entity Functions
67
void UFO_Sphere_State_Fixed(void);
68
void UFO_Sphere_State_Bouncing(void);
69
void UFO_Sphere_State_Moving(void);
70
void UFO_Sphere_State_Collected(void);
71
void UFO_Sphere_State_HandleRespawn(void);
72
void UFO_Sphere_State_AnimateAndDestroy(void);
73
74
#endif //! OBJ_UFO_SPHERE_H
75
76