Feel  5.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feel.SnakeBodyPart Class Reference

A class used to handle Feel's Snake demo's snake bodyparts More...

Inheritance diagram for MoreMountains.Feel.SnakeBodyPart:

Public Member Functions

virtual void Eat (float intensity)
 Called when the snake eats a new food More...
 
virtual void New ()
 Called when instantiating a new body part More...
 

Public Attributes

MMPositionRecorder TargetRecorder
 a position recorder this body part will look at to know where to go to More...
 
MMFeedbacks EatFeedback
 a feedback to play when food gets eaten More...
 
MMFeedbacks NewFeedback
 a feedback to play when this part appears More...
 
int Offset = 20
 
int Index = 0
 

Protected Member Functions

virtual void Awake ()
 On awake we store our collider and enable it after a delay More...
 
virtual IEnumerator ActivateCollider ()
 Activates this part's collider More...
 
void Update ()
 On update, we move to the recorded position of our predecessor More...
 
void OnTriggerEnter2D (Collider2D other)
 If we connect with the snake's head, we lose a part More...
 

Protected Attributes

Snake _snake
 
BoxCollider2D _collider2D
 

Detailed Description

A class used to handle Feel's Snake demo's snake bodyparts

Member Function Documentation

◆ ActivateCollider()

virtual IEnumerator MoreMountains.Feel.SnakeBodyPart.ActivateCollider ( )
protectedvirtual

Activates this part's collider

Returns

◆ Awake()

virtual void MoreMountains.Feel.SnakeBodyPart.Awake ( )
protectedvirtual

On awake we store our collider and enable it after a delay

◆ Eat()

virtual void MoreMountains.Feel.SnakeBodyPart.Eat ( float  intensity)
virtual

Called when the snake eats a new food

Parameters
intensity

◆ New()

virtual void MoreMountains.Feel.SnakeBodyPart.New ( )
virtual

Called when instantiating a new body part

◆ OnTriggerEnter2D()

void MoreMountains.Feel.SnakeBodyPart.OnTriggerEnter2D ( Collider2D  other)
protected

If we connect with the snake's head, we lose a part

Parameters
other

◆ Update()

void MoreMountains.Feel.SnakeBodyPart.Update ( )
protected

On update, we move to the recorded position of our predecessor

Member Data Documentation

◆ _collider2D

BoxCollider2D MoreMountains.Feel.SnakeBodyPart._collider2D
protected

◆ _snake

Snake MoreMountains.Feel.SnakeBodyPart._snake
protected

◆ EatFeedback

MMFeedbacks MoreMountains.Feel.SnakeBodyPart.EatFeedback

a feedback to play when food gets eaten

◆ Index

int MoreMountains.Feel.SnakeBodyPart.Index = 0

◆ NewFeedback

MMFeedbacks MoreMountains.Feel.SnakeBodyPart.NewFeedback

a feedback to play when this part appears

◆ Offset

int MoreMountains.Feel.SnakeBodyPart.Offset = 20

◆ TargetRecorder

MMPositionRecorder MoreMountains.Feel.SnakeBodyPart.TargetRecorder

a position recorder this body part will look at to know where to go to


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