Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/SPZ/EggJankenPart.c
338 views
1
// ---------------------------------------------------------------------
2
// RSDK Project: Sonic Mania
3
// Object Description: EggJankenPart Object
4
// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges
5
// Decompiled by: Rubberduckycooly & RMGRich
6
// ---------------------------------------------------------------------
7
8
#include "Game.h"
9
10
ObjectEggJankenPart *EggJankenPart = NULL;
11
12
void EggJankenPart_Update(void)
13
{
14
RSDK_THIS(EggJankenPart);
15
16
self->position.x += self->velocity.x;
17
self->position.y += self->velocity.y;
18
self->velocity.y += 0x3800;
19
20
self->rotation += self->angle;
21
22
if (!RSDK.CheckOnScreen(self, NULL))
23
destroyEntity(self);
24
}
25
26
void EggJankenPart_LateUpdate(void) {}
27
28
void EggJankenPart_StaticUpdate(void) {}
29
30
void EggJankenPart_Draw(void)
31
{
32
RSDK_THIS(EggJankenPart);
33
34
if (Zone->timer & 1)
35
RSDK.DrawSprite(&self->animator, NULL, false);
36
}
37
38
void EggJankenPart_Create(void *data)
39
{
40
RSDK_THIS(EggJankenPart);
41
42
RSDK.SetSpriteAnimation(EggJankenPart->aniFrames, 6, &self->animator, true, 0);
43
44
self->active = ACTIVE_BOUNDS;
45
self->updateRange.x = 0x800000;
46
self->updateRange.y = 0x800000;
47
self->visible = true;
48
self->drawGroup = Zone->objectDrawGroup[0] + 1;
49
self->drawFX |= FX_ROTATE | FX_FLIP;
50
51
self->animator.frameID = VOID_TO_INT(data);
52
}
53
54
void EggJankenPart_StageLoad(void) { EggJankenPart->aniFrames = RSDK.LoadSpriteAnimation("SPZ2/EggJanken.bin", SCOPE_STAGE); }
55
56
#if GAME_INCLUDE_EDITOR
57
void EggJankenPart_EditorDraw(void)
58
{
59
RSDK_THIS(EggJankenPart);
60
RSDK.DrawSprite(&self->animator, NULL, false);
61
}
62
63
void EggJankenPart_EditorLoad(void) { EggJankenPart->aniFrames = RSDK.LoadSpriteAnimation("SPZ2/EggJanken.bin", SCOPE_STAGE); }
64
#endif
65
66
void EggJankenPart_Serialize(void) {}
67
68