Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/TMZ/TeeterTotter.h
338 views
1
#ifndef OBJ_TEETERTOTTER_H
2
#define OBJ_TEETERTOTTER_H
3
4
#include "Game.h"
5
6
#define TEETERTOTTER_SEGMENT_COUNT (32)
7
8
typedef enum {
9
TEETERTOTTER_COLOR_ORANGEBLUE,
10
TEETERTOTTER_COLOR_BLUEORANGE,
11
} TeeterTotterColors;
12
13
// Object Class
14
struct ObjectTeeterTotter {
15
RSDK_OBJECT
16
uint16 aniFrames;
17
};
18
19
// Entity Class
20
struct EntityTeeterTotter {
21
RSDK_ENTITY
22
StateMachine(state);
23
uint8 color;
24
uint32 length;
25
Vector2 origin;
26
int32 unused1; // never even set
27
int32 playerIDs[PLAYER_COUNT];
28
int32 inactiveSegments;
29
int32 fallPos;
30
int32 fallVelocity;
31
int32 unused2; // set, but never used
32
int32 segmentPosition[TEETERTOTTER_SEGMENT_COUNT];
33
int32 segmentVelocity[TEETERTOTTER_SEGMENT_COUNT];
34
Hitbox hitbox;
35
Animator animator;
36
};
37
38
// Object Struct
39
extern ObjectTeeterTotter *TeeterTotter;
40
41
// Standard Entity Events
42
void TeeterTotter_Update(void);
43
void TeeterTotter_LateUpdate(void);
44
void TeeterTotter_StaticUpdate(void);
45
void TeeterTotter_Draw(void);
46
void TeeterTotter_Create(void *data);
47
void TeeterTotter_StageLoad(void);
48
#if GAME_INCLUDE_EDITOR
49
void TeeterTotter_EditorDraw(void);
50
void TeeterTotter_EditorLoad(void);
51
#endif
52
void TeeterTotter_Serialize(void);
53
54
// Extra Entity Functions
55
int32 TeeterTotter_CheckPlayerCollisions(void);
56
void TeeterTotter_ProcessSegmentGravity(void);
57
void TeeterTotter_HandleSegmentPositions(void);
58
59
void TeeterTotter_State_Init(void);
60
void TeeterTotter_State_Teeter(void);
61
void TeeterTotter_State_Fall(void);
62
63
#endif //! OBJ_TEETERTOTTER_H
64
65