playMaker

Author Topic: New to playmaker - golf power bar help  (Read 2753 times)

luchidejesus

  • Playmaker Newbie
  • *
  • Posts: 1
New to playmaker - golf power bar help
« on: May 31, 2013, 05:49:10 PM »
Hi guys,

I'm trying make a golf style game where the player will hold down the left mouse button in order to charge their shot.  When they release the button, the ball will be hit with a force calculated from the length of time the button was held down.

Does anyone have any tips on how to do this?

I currently have an FSM with 3 states:

1. Idle - Waiting for the left mouse button to be pressed down
2. Charging - Activated as soon as the button is pressed and ending when the button is released
3. Shot - Activated as soon as the button is released.

The contents so far are pretty empty, what I've described above works.  I just need to understand how I get the FSM to measure the amount of time the button is held for and store that as a variable which will then become a physical force for the shot.

Any help would be greatly appreciated.

Thanks.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: New to playmaker - golf power bar help
« Reply #1 on: May 31, 2013, 08:44:25 PM »
 So in the charging state just make a float and add to it per frame/second, then use that as your power multiplier for the hit.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D