Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/GHZ/Newtron.h
338 views
1
#ifndef OBJ_NEWTRON_H
2
#define OBJ_NEWTRON_H
3
4
#include "Game.h"
5
6
typedef enum {
7
NEWTRON_SHOOT,
8
NEWTRON_FLY,
9
NEWTRON_PROJECTILE,
10
} NewtronTypes;
11
12
// Object Class
13
struct ObjectNewtron {
14
RSDK_OBJECT
15
Hitbox hitboxShoot;
16
Hitbox hitboxFly; // not sure why isn't this used in this object... GHZ/CheckerBall uses it though
17
Hitbox hitboxProjectile;
18
Hitbox hitboxRange;
19
uint16 aniFrames;
20
};
21
22
// Entity Class
23
struct EntityNewtron {
24
RSDK_ENTITY
25
StateMachine(state);
26
uint8 type;
27
int32 timer;
28
Vector2 startPos;
29
Animator animator;
30
Animator flameAnimator;
31
};
32
33
// Object Struct
34
extern ObjectNewtron *Newtron;
35
36
// Standard Entity Events
37
void Newtron_Update(void);
38
void Newtron_LateUpdate(void);
39
void Newtron_StaticUpdate(void);
40
void Newtron_Draw(void);
41
void Newtron_Create(void *data);
42
void Newtron_StageLoad(void);
43
#if GAME_INCLUDE_EDITOR
44
void Newtron_EditorDraw(void);
45
void Newtron_EditorLoad(void);
46
#endif
47
void Newtron_Serialize(void);
48
49
// Extra Entity Functions
50
void Newtron_DebugDraw(void);
51
void Newtron_DebugSpawn(void);
52
53
// Helpers
54
void Newtron_CheckPlayerCollisions(void);
55
void Newtron_CheckOffScreen(void);
56
void Newtron_GetTargetDir(void);
57
58
// States
59
void Newtron_State_Init(void);
60
void Newtron_State_CheckPlayerInRange(void);
61
void Newtron_State_Appear(void);
62
void Newtron_State_StartFly(void);
63
void Newtron_State_Fly(void);
64
65
void Newtron_State_Shoot(void);
66
void Newtron_State_FadeAway(void);
67
68
void Newtron_State_Projectile(void);
69
70
#endif //! OBJ_NEWTRON_H
71
72