Corgi Engine  v8.8
MoreMountains.CorgiEngine.LevelMapCharacter Class Reference

A controller for the level map's main character More...

Inheritance diagram for MoreMountains.CorgiEngine.LevelMapCharacter:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Member Functions

virtual void InputMovement ()
 Handles input and decides if we can move or not More...
 
virtual void MoveCharacter ()
 Moves the character to the set destination More...
 
virtual void AnimateCharacter ()
 Animates the character if it has an animator set Also flips the character if needed More...
 
virtual void SetCurrentPathElement (LevelMapPathElement pathElement)
 Sets the current path element. More...
 
virtual void SetDestination (LevelMapPathElement newDestination)
 Sets the destination. More...
 

Public Attributes

string PlayerID = "Player1"
 the player ID (for input manager) More...
 
float CharacterSpeed
 the character's movement speed More...
 
LevelMapPathElement StartingPoint
 the point on the map at which the character should spawn More...
 
bool CharacterIsFacingRight =true
 true if the character is currently facing right More...
 

Protected Member Functions

virtual void Start ()
 Initialization More...
 
virtual void Update ()
 On update, we get the input, decide if we should move or not, and if needed move the character and animate it More...
 
virtual void Flip ()
 Flip the character horizontally More...
 
virtual void ButtonPressed ()
 When the jump button is pressed More...
 
virtual void SetHorizontalMove (float value)
 Sets the horizontal move. More...
 
virtual void SetVerticalMove (float value)
 Sets the vertical move. More...
 

Protected Attributes

LevelMapPathElement _destination
 
bool _shouldMove =false
 
float _horizontalMove
 
float _verticalMove
 
float _threshold =0.1f
 
Vector3 _offset
 
Vector3 _positionLastFrame
 
float _currentSpeed =0f
 
string _movement
 
LevelMapPathElement _currentPathElement
 
Rigidbody2D _rigidbody2D
 
BoxCollider2D _boxCollider2D
 
Animator _animator
 

Properties

bool CollidingWithAPathElement [get, set]
 true if the character colliding with a path element at this frame More...
 
LevelMapPathElement LastVisitedPathElement [get, set]
 the last visited path element More...
 

Detailed Description

A controller for the level map's main character

Member Function Documentation

◆ AnimateCharacter()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.AnimateCharacter ( )
virtual

Animates the character if it has an animator set Also flips the character if needed

◆ ButtonPressed()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.ButtonPressed ( )
protectedvirtual

When the jump button is pressed

◆ Flip()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.Flip ( )
protectedvirtual

Flip the character horizontally

◆ InputMovement()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.InputMovement ( )
virtual

Handles input and decides if we can move or not

Parameters
movementMovement.

◆ MoveCharacter()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.MoveCharacter ( )
virtual

Moves the character to the set destination

◆ SetCurrentPathElement()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.SetCurrentPathElement ( LevelMapPathElement  pathElement)
virtual

Sets the current path element.

Parameters
pathElementPath element.

◆ SetDestination()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.SetDestination ( LevelMapPathElement  newDestination)
virtual

Sets the destination.

Parameters
newDestinationNew destination.

◆ SetHorizontalMove()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.SetHorizontalMove ( float  value)
protectedvirtual

Sets the horizontal move.

Parameters
valueValue.

◆ SetVerticalMove()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.SetVerticalMove ( float  value)
protectedvirtual

Sets the vertical move.

Parameters
valueValue.

◆ Start()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.Start ( )
protectedvirtual

Initialization

◆ Update()

virtual void MoreMountains.CorgiEngine.LevelMapCharacter.Update ( )
protectedvirtual

On update, we get the input, decide if we should move or not, and if needed move the character and animate it

Member Data Documentation

◆ _animator

Animator MoreMountains.CorgiEngine.LevelMapCharacter._animator
protected

◆ _boxCollider2D

BoxCollider2D MoreMountains.CorgiEngine.LevelMapCharacter._boxCollider2D
protected

◆ _currentPathElement

LevelMapPathElement MoreMountains.CorgiEngine.LevelMapCharacter._currentPathElement
protected

◆ _currentSpeed

float MoreMountains.CorgiEngine.LevelMapCharacter._currentSpeed =0f
protected

◆ _destination

LevelMapPathElement MoreMountains.CorgiEngine.LevelMapCharacter._destination
protected

◆ _horizontalMove

float MoreMountains.CorgiEngine.LevelMapCharacter._horizontalMove
protected

◆ _movement

string MoreMountains.CorgiEngine.LevelMapCharacter._movement
protected

◆ _offset

Vector3 MoreMountains.CorgiEngine.LevelMapCharacter._offset
protected

◆ _positionLastFrame

Vector3 MoreMountains.CorgiEngine.LevelMapCharacter._positionLastFrame
protected

◆ _rigidbody2D

Rigidbody2D MoreMountains.CorgiEngine.LevelMapCharacter._rigidbody2D
protected

◆ _shouldMove

bool MoreMountains.CorgiEngine.LevelMapCharacter._shouldMove =false
protected

◆ _threshold

float MoreMountains.CorgiEngine.LevelMapCharacter._threshold =0.1f
protected

◆ _verticalMove

float MoreMountains.CorgiEngine.LevelMapCharacter._verticalMove
protected

◆ CharacterIsFacingRight

bool MoreMountains.CorgiEngine.LevelMapCharacter.CharacterIsFacingRight =true

true if the character is currently facing right

◆ CharacterSpeed

float MoreMountains.CorgiEngine.LevelMapCharacter.CharacterSpeed

the character's movement speed

◆ PlayerID

string MoreMountains.CorgiEngine.LevelMapCharacter.PlayerID = "Player1"

the player ID (for input manager)

◆ StartingPoint

LevelMapPathElement MoreMountains.CorgiEngine.LevelMapCharacter.StartingPoint

the point on the map at which the character should spawn

Property Documentation

◆ CollidingWithAPathElement

bool MoreMountains.CorgiEngine.LevelMapCharacter.CollidingWithAPathElement
getset

true if the character colliding with a path element at this frame

◆ LastVisitedPathElement

LevelMapPathElement MoreMountains.CorgiEngine.LevelMapCharacter.LastVisitedPathElement
getset

the last visited path element


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