playMaker

Author Topic: Global/Background Timer  (Read 1807 times)

coneilll89

  • Playmaker Newbie
  • *
  • Posts: 5
Global/Background Timer
« on: April 26, 2013, 03:39:00 PM »
Hello,

In my game the player has an ability that slows down all onscreen enemies. When the player uses the ability, an event is sent to all enemies, and the variable that controls their movement speed is cut in half. My problem is getting the movement speed back to normal. I need the enemy's FSM to be able to use other states while in "slow mode". I'm not sure how to reset the movement speed variable after time has passed without forcing the FSM to stay in one state.

Is there a global timer of some kind I can use that will continue working in the background while the FSM shifts between states? My other thought was to create a separate FSM for all movement related states. Would that slow performance?

Thank you



Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Global/Background Timer
« Reply #1 on: April 27, 2013, 02:22:21 AM »
I'm not sure I understand your setup, but I would use one FSM just to manage game time. When you want to scale time, you send an event to that FSM and it decides how to handle it; it can also Broadcast time related events that other FSMs need to know about...