playMaker

Author Topic: Power/ accuracy bar  (Read 2538 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Power/ accuracy bar
« on: October 03, 2011, 11:02:27 AM »
I'm trying to create a power/accuracy meter very similar to the one used for a kickoff in Madden football. Basically, a bar starts at the far left, and rapidly moves to the right side (where the player must click while the bar is close to full power). Then, the bar falls back to the left where the player must click again to determine the accuracy of the shot.

My issue is that I'm using the same button (left mouse) for both of these clicks. How do I store a value the first time the player has clicked, then store a value AND send an event the second time clicked? In other words, the player must make two clicks before sending an event and entering another state. Any suggestions as to how I might go about this would be greatly appreciated! Thank you!

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Power/ accuracy bar
« Reply #1 on: October 03, 2011, 11:37:09 AM »
Well just off the top of my head i would say that you are in one state waiting for the first click,  your value could just be constantly updating to the bar value and then it will stick there when you exit this state.. you get a click and the value sticks and head to the next State with the mouse click event option to wait for the next click.. and so on..

Q

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Re: Power/ accuracy bar
« Reply #2 on: October 04, 2011, 12:51:40 PM »
I thought about doing it this way, however, the bar resets when going to a new state. For example: You're in state 1 and the bar is moving back and fourth. As soon as you click a button to determine power, the value is stored and you enter the next state. The problem is, rather that continuing on its course, the bar resets itself (starts back at 0). I'm not quite sure how to set the float value so that the bar would continue on it's normal path.