A class used to handle Feel's Snake demo's snake "head", the part controlled by the player
More...
|
| virtual void | Turn () |
| | Called when turning, rotates the snake's head, changes its direction, plays a feedback More...
|
| |
| virtual void | Teleport () |
| | Called by the snake head's MMViewportEdgeTeleporter, defines what happens when the snake is teleported to the other side of the screen More...
|
| |
| virtual void | Eat () |
| | Called when eating food, triggers visual effects, increases points, plays a feedback More...
|
| |
| virtual void | EatEffect () |
| | When eating food, we instantiate a new body part unless we've reached our limit More...
|
| |
| virtual void | Lose (SnakeBodyPart part) |
| | When we lose a body part, we play a feedback, destroy the last part, lose points, and update our points display More...
|
| |
|
| void | Awake () |
| | On Awake, we initialize our snake's points, speed, position recorder, and body parts container More...
|
| |
| virtual void | Update () |
| | Every frame, we check for input and move our snake's head More...
|
| |
| virtual void | HandleInput () |
| | Every frame, looks for turn input More...
|
| |
| virtual void | HandleMovement () |
| | Every frame, moves the snake's head's position More...
|
| |
| virtual IEnumerator | TeleportCo () |
| | A coroutine used to teleport the snake to the other side of the screen More...
|
| |
| virtual IEnumerator | EatCo () |
| | A coroutine used to go through every snake body part and trigger its Eat MMFeedbacks More...
|
| |
A class used to handle Feel's Snake demo's snake "head", the part controlled by the player
◆ Awake()
| void MoreMountains.Feel.Snake.Awake |
( |
| ) |
|
|
protected |
On Awake, we initialize our snake's points, speed, position recorder, and body parts container
◆ Eat()
| virtual void MoreMountains.Feel.Snake.Eat |
( |
| ) |
|
|
virtual |
Called when eating food, triggers visual effects, increases points, plays a feedback
◆ EatCo()
| virtual IEnumerator MoreMountains.Feel.Snake.EatCo |
( |
| ) |
|
|
protectedvirtual |
A coroutine used to go through every snake body part and trigger its Eat MMFeedbacks
◆ EatEffect()
| virtual void MoreMountains.Feel.Snake.EatEffect |
( |
| ) |
|
|
virtual |
When eating food, we instantiate a new body part unless we've reached our limit
◆ HandleInput()
| virtual void MoreMountains.Feel.Snake.HandleInput |
( |
| ) |
|
|
protectedvirtual |
Every frame, looks for turn input
◆ HandleMovement()
| virtual void MoreMountains.Feel.Snake.HandleMovement |
( |
| ) |
|
|
protectedvirtual |
Every frame, moves the snake's head's position
◆ Lose()
When we lose a body part, we play a feedback, destroy the last part, lose points, and update our points display
- Parameters
-
◆ Teleport()
| virtual void MoreMountains.Feel.Snake.Teleport |
( |
| ) |
|
|
virtual |
Called by the snake head's MMViewportEdgeTeleporter, defines what happens when the snake is teleported to the other side of the screen
◆ TeleportCo()
| virtual IEnumerator MoreMountains.Feel.Snake.TeleportCo |
( |
| ) |
|
|
protectedvirtual |
A coroutine used to teleport the snake to the other side of the screen
- Returns
◆ Turn()
| virtual void MoreMountains.Feel.Snake.Turn |
( |
| ) |
|
|
virtual |
Called when turning, rotates the snake's head, changes its direction, plays a feedback
◆ Update()
| virtual void MoreMountains.Feel.Snake.Update |
( |
| ) |
|
|
protectedvirtual |
Every frame, we check for input and move our snake's head
◆ _lastFoodEatenAt
| float MoreMountains.Feel.Snake._lastFoodEatenAt = -100f |
◆ _lastLostPart
| float MoreMountains.Feel.Snake._lastLostPart = 0f |
|
protected |
◆ _newPosition
| Vector3 MoreMountains.Feel.Snake._newPosition |
|
protected |
◆ _recorder
◆ _snakeBodyParts
◆ _speed
| float MoreMountains.Feel.Snake._speed |
◆ _speedMultiplier
| float MoreMountains.Feel.Snake._speedMultiplier |
◆ BodyPartPrefab
the prefab to use for body parts
◆ BodyPartsOffset
| int MoreMountains.Feel.Snake.BodyPartsOffset = 7 |
the offset to apply between two parts
◆ BoostDuration
| float MoreMountains.Feel.Snake.BoostDuration = 2f |
the duration of the boost, in seconds
◆ BoostMultiplier
| float MoreMountains.Feel.Snake.BoostMultiplier = 2f |
the speed multiplier to apply to the speed when boosting
◆ Direction
| Vector3 MoreMountains.Feel.Snake.Direction = Vector2.right |
the current direction of the snake
◆ EatFeedback
a feedback to play when eating snake food
◆ LoseFeedback
a feedback to play when losing a body part
◆ MaxAmountOfBodyParts
| int MoreMountains.Feel.Snake.MaxAmountOfBodyParts = 10 |
the maximum amount of body parts for this snake
◆ MinTimeBetweenLostParts
| float MoreMountains.Feel.Snake.MinTimeBetweenLostParts = 2f |
the minimum duration, in seconds, between 2 allowed parts losses
◆ NormalSpeedMultiplier
| float MoreMountains.Feel.Snake.NormalSpeedMultiplier = 1f |
the speed multiplier to apply at most times
◆ SnakePoints
| int MoreMountains.Feel.Snake.SnakePoints = 0 |
◆ Speed
| float MoreMountains.Feel.Snake.Speed = 5f |
the snake's movement speed
◆ SpeedChangeRate
| float MoreMountains.Feel.Snake.SpeedChangeRate = 0.2f |
the rate at which speed should vary
◆ TeleportFeedback
a feedback to play when the snake teleports to the other side of the screen
◆ TeleportOnceFeedback
| MMFeedbacks MoreMountains.Feel.Snake.TeleportOnceFeedback |
a feedback to play when teleporting once
◆ TurnFeedback
a feedback to play when the snake turns
The documentation for this class was generated from the following file:
- F:/Github/Store/Feel/Assets/Feel/FeelDemos/Snake/Scripts/Snake.cs