playMaker

Author Topic: Points Pool help  (Read 391 times)

Adam Z

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Points Pool help
« on: November 26, 2018, 08:36:21 AM »
So for my game I have 4 sliders: Strength, Speed, Constitution, and Intelligence. Each of those sliders are set to 50 out of 100. I would like to give the player 100 extra points to the "point pool" to distribute to those sliders. I would also like the player to be able to reduce the other sliders to add to that "point pool".

Any thoughts on the best way to do this? Thanks.

Adam Z

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Points Pool help
« Reply #1 on: April 03, 2019, 08:33:13 PM »
Anyone have any thoughts?  Thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14593
  • Official Playmaker Support
    • View Profile
Re: Points Pool help
« Reply #2 on: April 04, 2019, 02:07:05 AM »
Hi,

 you need to implement the logic in a mathematical way.

 I would start easy with only two sliders, each slider is not the actual controller of the value, rather, an fsm is responsible for that and the slider merely show the current value and also set it.

 the BIG trick here is that if you want to control a slider value, you end up with a recursive loop if you also want to listen to the value changing event of that slider.

 solution:

- don't implement the on value change event, but simply implement the drag event on the slider button, then when the user is moving the slider, you know about it, you get its current value and work you math, that will affect in turns other sliders.

does that make sense?

 Bye,

 Jean