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

An example class part of the Feel demos This class handles the strike demo, detecting input and applying force to the ball More...

Inheritance diagram for MoreMountains.Feel.Strike:

Public Member Functions

virtual void ThrowBall ()
 This method, meant to be called by a feedback once it's ready to throw, will apply force to the ball. In a "normal" game this probably would be directly called by this class, but here we want to make sure all the previous feedbacks have played, and that's handled by the ThrowBallFeedback. More...
 

Public Attributes

KeyCode ActionKey = KeyCode.Space
 a key to use to throw the ball More...
 
KeyCode ActionKeyAlt = KeyCode.Joystick1Button0
 a secondary key to use to throw the ball More...
 
Rigidbody BowlingBallRb
 the rigidbody of the bowling ball More...
 
Collider PointsCollider
 a collider used to count points (still standing pins will overlap with it) More...
 
List< Rigidbody > Pins
 the rigidbody of the pins More...
 
MMWiggle BowlingBallLauncherWiggler
 the wiggler that makes the launcher rotate More...
 
Text LastScoreText
 the text component used to display the current last score More...
 
Text TotalScoreText
 the text component used to display the total score More...
 
Text ConsecutiveStrikesText
 the text component used to display the number of consecutive strikes More...
 
List< GameObject > StrikeElements
 a list of elements to turn on/off in case of strike More...
 
Vector3 ThrowingForce = new Vector3(0, 0, 10f)
 the force to apply when throwing the ball More...
 
Vector3 Gravity = new Vector3(0f, -9.81f, 0f)
 the gravity to apply More...
 
float MaxDurationBeforeReset = 4f
 the max duration before a reset More...
 
float DelayBeforeReset = 1f
 the delay to wait for (in seconds) before resetting the scene More...
 
float DelayForPoints = 1f
 the delay to wait for (in seconds) while counting/displaying points More...
 
MMFeedbacks ThrowBallFeedback
 a feedback to call when throwing the ball More...
 
MMFeedbacks ResetFeedback
 a feedback to call when resetting the scene More...
 
MMFeedbacks StrikeFeedback
 a feedback played when hitting a strike More...
 
MMFeedbacks NoStrikeFeedback
 a feedback played when missing a strike More...
 
int LastScore = 0
 the last score you hit More...
 
int TotalPoints = 0
 The total amount of points since the start. More...
 
int ConsecutiveStrikes = 0
 the amount of consecutive strikes More...
 

Protected Member Functions

virtual void Start ()
 On Start we initialize our scene More...
 
virtual void Initialization ()
 Initializes physics settings, stores initial positions More...
 
virtual void SetStrikeElements (bool status)
 
virtual void Update ()
 On Update we look for input More...
 
virtual void HandleInput ()
 Detects input More...
 
virtual void StartBall ()
 Performs a jump if possible, otherwise plays a denied feedback More...
 
void OnTriggerEnter (Collider other)
 When colliding with the catcher, we reset More...
 
virtual IEnumerator ResetCountdown ()
 A countdown used to reset the scene after a max delay More...
 
virtual IEnumerator ResetSceneCo ()
 Resets the whole scene More...
 
virtual void CountPoints ()
 

Protected Attributes

bool _ballThrown = false
 
Vector3 _initialBallPosition
 
Quaternion _initialBallRotation
 
List< StrikePin_strikePins
 
List< Collider > _pinColliders
 
Coroutine _resetCoroutine
 

Detailed Description

An example class part of the Feel demos This class handles the strike demo, detecting input and applying force to the ball

Member Function Documentation

◆ CountPoints()

virtual void MoreMountains.Feel.Strike.CountPoints ( )
protectedvirtual

◆ HandleInput()

virtual void MoreMountains.Feel.Strike.HandleInput ( )
protectedvirtual

Detects input

◆ Initialization()

virtual void MoreMountains.Feel.Strike.Initialization ( )
protectedvirtual

Initializes physics settings, stores initial positions

◆ OnTriggerEnter()

void MoreMountains.Feel.Strike.OnTriggerEnter ( Collider  other)
protected

When colliding with the catcher, we reset

Parameters
other

◆ ResetCountdown()

virtual IEnumerator MoreMountains.Feel.Strike.ResetCountdown ( )
protectedvirtual

A countdown used to reset the scene after a max delay

Returns

◆ ResetSceneCo()

virtual IEnumerator MoreMountains.Feel.Strike.ResetSceneCo ( )
protectedvirtual

Resets the whole scene

Returns

◆ SetStrikeElements()

virtual void MoreMountains.Feel.Strike.SetStrikeElements ( bool  status)
protectedvirtual

◆ Start()

virtual void MoreMountains.Feel.Strike.Start ( )
protectedvirtual

On Start we initialize our scene

◆ StartBall()

virtual void MoreMountains.Feel.Strike.StartBall ( )
protectedvirtual

Performs a jump if possible, otherwise plays a denied feedback

◆ ThrowBall()

virtual void MoreMountains.Feel.Strike.ThrowBall ( )
virtual

This method, meant to be called by a feedback once it's ready to throw, will apply force to the ball. In a "normal" game this probably would be directly called by this class, but here we want to make sure all the previous feedbacks have played, and that's handled by the ThrowBallFeedback.

◆ Update()

virtual void MoreMountains.Feel.Strike.Update ( )
protectedvirtual

On Update we look for input

Member Data Documentation

◆ _ballThrown

bool MoreMountains.Feel.Strike._ballThrown = false
protected

◆ _initialBallPosition

Vector3 MoreMountains.Feel.Strike._initialBallPosition
protected

◆ _initialBallRotation

Quaternion MoreMountains.Feel.Strike._initialBallRotation
protected

◆ _pinColliders

List<Collider> MoreMountains.Feel.Strike._pinColliders
protected

◆ _resetCoroutine

Coroutine MoreMountains.Feel.Strike._resetCoroutine
protected

◆ _strikePins

List<StrikePin> MoreMountains.Feel.Strike._strikePins
protected

◆ ActionKey

KeyCode MoreMountains.Feel.Strike.ActionKey = KeyCode.Space

a key to use to throw the ball

◆ ActionKeyAlt

KeyCode MoreMountains.Feel.Strike.ActionKeyAlt = KeyCode.Joystick1Button0

a secondary key to use to throw the ball

◆ BowlingBallLauncherWiggler

MMWiggle MoreMountains.Feel.Strike.BowlingBallLauncherWiggler

the wiggler that makes the launcher rotate

◆ BowlingBallRb

Rigidbody MoreMountains.Feel.Strike.BowlingBallRb

the rigidbody of the bowling ball

◆ ConsecutiveStrikes

int MoreMountains.Feel.Strike.ConsecutiveStrikes = 0

the amount of consecutive strikes

◆ ConsecutiveStrikesText

Text MoreMountains.Feel.Strike.ConsecutiveStrikesText

the text component used to display the number of consecutive strikes

◆ DelayBeforeReset

float MoreMountains.Feel.Strike.DelayBeforeReset = 1f

the delay to wait for (in seconds) before resetting the scene

◆ DelayForPoints

float MoreMountains.Feel.Strike.DelayForPoints = 1f

the delay to wait for (in seconds) while counting/displaying points

◆ Gravity

Vector3 MoreMountains.Feel.Strike.Gravity = new Vector3(0f, -9.81f, 0f)

the gravity to apply

◆ LastScore

int MoreMountains.Feel.Strike.LastScore = 0

the last score you hit

◆ LastScoreText

Text MoreMountains.Feel.Strike.LastScoreText

the text component used to display the current last score

◆ MaxDurationBeforeReset

float MoreMountains.Feel.Strike.MaxDurationBeforeReset = 4f

the max duration before a reset

◆ NoStrikeFeedback

MMFeedbacks MoreMountains.Feel.Strike.NoStrikeFeedback

a feedback played when missing a strike

◆ Pins

List<Rigidbody> MoreMountains.Feel.Strike.Pins

the rigidbody of the pins

◆ PointsCollider

Collider MoreMountains.Feel.Strike.PointsCollider

a collider used to count points (still standing pins will overlap with it)

◆ ResetFeedback

MMFeedbacks MoreMountains.Feel.Strike.ResetFeedback

a feedback to call when resetting the scene

◆ StrikeElements

List<GameObject> MoreMountains.Feel.Strike.StrikeElements

a list of elements to turn on/off in case of strike

◆ StrikeFeedback

MMFeedbacks MoreMountains.Feel.Strike.StrikeFeedback

a feedback played when hitting a strike

◆ ThrowBallFeedback

MMFeedbacks MoreMountains.Feel.Strike.ThrowBallFeedback

a feedback to call when throwing the ball

◆ ThrowingForce

Vector3 MoreMountains.Feel.Strike.ThrowingForce = new Vector3(0, 0, 10f)

the force to apply when throwing the ball

◆ TotalPoints

int MoreMountains.Feel.Strike.TotalPoints = 0

The total amount of points since the start.

◆ TotalScoreText

Text MoreMountains.Feel.Strike.TotalScoreText

the text component used to display the total score


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