Path: blob/master/SonicMania/Objects/Global/Animals.h
338 views
#ifndef OBJ_ANIMALS_H1#define OBJ_ANIMALS_H23#include "Game.h"45typedef enum {6ANIMAL_FLICKY,7ANIMAL_RICKY,8ANIMAL_POCKY,9ANIMAL_PECKY,10ANIMAL_PICKY,11ANIMAL_CUCKY,12ANIMAL_ROCKY,13ANIMAL_BECKY,14ANIMAL_LOCKY,15ANIMAL_TOCKY,16ANIMAL_WOCKY,17ANIMAL_MICKY,18} AnimalTypes;1920typedef enum {21ANIMAL_BEHAVE_FREE,22ANIMAL_BEHAVE_FOLLOW,23ANIMAL_BEHAVE_FIXED,24} AnimalBehaviours;2526// Object Class27struct ObjectAnimals {28RSDK_OBJECT29TABLE(int32 hitboxes[12], { 0x70000, 0x70000, 0xC0000, 0xA0000, 0x80000, 0x80000, 0x80000, 0x80000, 0x70000, 0x50000, 0x70000, 0x60000 });30TABLE(int32 gravityStrength[12], { 0x1800, 0x3800, 0x3800, 0x3800, 0x3800, 0x3800, 0x3800, 0x3800, 0x1800, 0x3800, 0x3800, 0x3800 });31TABLE(int32 yVelocity[12],32{ -0x40000, -0x38000, -0x40000, -0x30000, -0x30000, -0x30000, -0x18000, -0x30000, -0x30000, -0x20000, -0x30000, -0x38000 });33TABLE(int32 xVelocity[12],34{ -0x30000, -0x28000, -0x20000, -0x18000, -0x1C000, -0x20000, -0x14000, -0x20000, -0x28000, -0x14000, -0x2C000, -0x20000 });35uint16 aniFrames;36int32 animalTypes[2];37bool32 hasPlatform;38bool32 hasBridge;39};4041// Entity Class42struct EntityAnimals {43RSDK_ENTITY44StateMachine(state);45int32 timer;46AnimalTypes type;47AnimalBehaviours behaviour;48Animator animator;49Hitbox hitboxAnimal;50};5152// Object Struct53extern ObjectAnimals *Animals;5455// Standard Entity Events56void Animals_Update(void);57void Animals_LateUpdate(void);58void Animals_StaticUpdate(void);59void Animals_Draw(void);60void Animals_Create(void *data);61void Animals_StageLoad(void);62#if GAME_INCLUDE_EDITOR63void Animals_EditorDraw(void);64void Animals_EditorLoad(void);65#endif66void Animals_Serialize(void);6768// Extra Entity Functions69void Animals_CheckDirection(void);70bool32 Animals_CheckPlatformCollision(void *platform);71bool32 Animals_CheckGroundCollision(void);7273void Animals_State_Fall(void);74void Animals_State_Bounce(void);75void Animals_State_Fly(void);76void Animals_State_Placed(void);77#endif //! OBJ_ANIMALS_H787980