Project Arrhythmia
A video game developed by Vitamin Games.
Loading...
Searching...
No Matches
VGPlayer Class Reference

A class that represents a player in the game. More...

+ Inheritance diagram for VGPlayer:

Public Types

enum  ParticleTypes { Spawn , Boost , Hit , Die }
 

Public Member Functions

delegate void HitDelegate (int _health, Vector3 _pos)
 
delegate void DeathDelegate (Vector3 _pos)
 
delegate void CloseCallDelegate (Vector3 _pos)
 
delegate void BoostDelegate (Vector3 _pos)
 
 VGPlayer (int _index)
 
void ClearEvents ()
 
void Init (int _index, Camera _cam, bool _spawn=true)
 
void OnChildTriggerEnter (Collider2D _other)
 
void OnChildTriggerStay (Collider2D _other)
 
void OnChildTriggerEnterCloseCall (Collider2D _other)
 
IEnumerator RegisterCloseCall (Vector3 _pos)
 
void ForceKill ()
 
void PlayerDeath (float _destroyDelay=0.2f)
 
void SetColor (Color _col, Color _colTail)
 
void PausePlayer (bool _pause=true)
 

Public Attributes

AnimationCurve BoostSandyCurve
 
AnimationCurve BoostSandyDecayCurve
 
ParticleSystem PS_Spawn
 
ParticleSystem PS_Boost
 
ParticleSystem PS_Hit
 
ParticleSystem PS_Die
 
Camera ObjectCamera
 
Rigidbody2D Player_Rigidbody
 
Transform Player_Wrapper
 
Transform Player_Core
 
Transform Player_Boost
 
PlayerTrail Player_Trail
 
GameObject PlayerDashPrefab
 
PlayerText SpeechBubble
 
int PlayerID
 
int Health
 
bool IsPaused
 
bool CanMove
 
bool CanTakeDamage
 
float isHurting
 
float isHurtingHold
 
bool CanBoost
 
bool IsBoosting
 
bool IsHoldingBoost
 
float BoostDuration
 
Color PlayerColor
 
Color TailColor
 
Rewired.Player PlayerInput
 
AnimationCurve EdgeCurve
 

Static Public Attributes

static readonly string ANIM_INVALID = "Player_invalid"
 
static readonly string ANIM_SPAWN = "Player_spawn"
 
static readonly string ANIM_IDLE = "Player_idle"
 
static readonly string ANIM_BOOST = "Player_boost"
 
static readonly string ANIM_EXCITE = "Player_excite"
 
static readonly string ANIM_HURT = "Player_hurt"
 
static readonly string ANIM_DIE = "Player_die"
 
static readonly int DEFAULT_SANDY_SPAWNS = 4
 
static readonly float DEFAULT_INVINCIBLE_TIME = 2f
 
static readonly float DEFAULT_DASH_TIME_MIN = 0.075f
 
static readonly float DEFAULT_DASH_TIME_MAX = 0.18f
 
static readonly float DEFAULT_SPEED = 20f
 
static readonly float DEFAULT_BOOST_SPEED = 85f
 
static readonly float DEFAULT_ROTATION_LERP = 720f
 
static readonly int DEFAULT_HEALTH = 3
 
static readonly float EDGE_OFFSET = 0.03f
 
static readonly float CLOSECALL_TIME = 0.2f
 
static readonly float SPAWN_TIME = 0.417f
 

Properties

bool IsHurt [get]
 
string CurrentState [get]
 
bool isDead [get]
 
Rewired.Player RPlayer [get]
 

Events

HitDelegate HitEvent
 
DeathDelegate DeathEvent
 
CloseCallDelegate CloseCallEvent
 
BoostDelegate BoostEvent
 

Private Member Functions

void Init ()
 
void ForceMoveXLock (bool _lock)
 
void ForceMoveYLock (bool _lock)
 
void ForceDashLock (bool _lock)
 
void ForceDashDirection (Vector2 _direction)
 
void ForceMovePlayer (Vector2 _pos, float _time)
 
void ChangeAnimationState (string _newState)
 
void PlayParticles (ParticleTypes _type)
 
IEnumerator KillParticleSystem (ParticleSystem _ps)
 
void SetState (float _delay, bool _canMove, bool _canTakeDamage, bool _canBoost)
 
IEnumerator SetStateDelay (float _delay, bool _canMove, bool _canTakeDamage, bool _canBoost)
 
void SetState (bool _canMove, bool _canTakeDamage, bool _canBoost)
 
void SetState (bool _canMove, bool _canTakeDamage)
 
void SetDamage (bool _canTakeDamage, float _maintainTime)
 
void SetDamage (bool _canTakeDamage, bool _force=true)
 
void Spawn ()
 
IEnumerator SpawnLoop ()
 
void Update ()
 
void LateUpdate ()
 
void PlayerHit ()
 
void PlayerDeathAnimation ()
 
void PlayerHitAnimation ()
 
void OnDestroy ()
 
void HandleBoost ()
 
void HandleLastMove ()
 
void HandlePlayerInput ()
 
void RotatePlayer ()
 
void UpdatePlayerVelocity ()
 
void ClampPlayerPosition ()
 
void StartBoost ()
 
void EndBoost ()
 
IEnumerator SpawnSandyInstances ()
 
void StartHurtDecay ()
 
IEnumerator StartHurtDecayLoop ()
 

Private Attributes

Animator Animator
 
string p_currentState
 
bool Control_MoveX = true
 
bool Control_MoveY = true
 
bool Control_MoveDash = true
 
bool p_MonoColor
 
Rewired.Player p_Player
 
float p_lastMoveX = 1
 
float p_lastMoveY = 0
 
float CurrentSpeed = 0
 
Vector2 internalVelocity = Vector2.zero
 
Vector2 ForcedLastMove = Vector2.zero
 

Detailed Description

A class that represents a player in the game.

This class contains properties and methods related to the player's actions and states in the game. It includes operations like spawning, idling, boosting, getting excited, getting hurt, and dying.


The documentation for this class was generated from the following file: