playMaker

Author Topic: creating a number counter to cause event  (Read 2028 times)

gizmosan

  • Playmaker Newbie
  • *
  • Posts: 1
creating a number counter to cause event
« on: April 21, 2013, 10:44:47 PM »
Hey Guys,

The scenario is, I have been following a tutorial for creating a breakout style game, at the moment I have a sphere that when it touches a block particle effects are emitted, and the block disappears. 

I'm trying to figure out how to create a counter, so when the ball hits 3 blocks in a row, I can spawn another FX which says "combo" any ideas on creating something like that?

Been looking for a compare or something, I know how I would do it in UDK Kismet, just not in Playmaker :(
FX Artist

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: creating a number counter to cause event
« Reply #1 on: April 22, 2013, 12:56:29 AM »
Hi,

 that's quite simple, everytime the ball hit a brick, you increment a integer, and everytime you do increment it, you compare that integer with a value, and if greater you trigger an effect, AND you reset that counter ( else it would trigger that effect over and over again after that).

 Does that make sense? The key to create easy systems like that is to fire a global event like "BALL HIT BRICK" or something, and then any fsm can listen to it and maintain it's own behavior, you could have several bonus based on different number of hits. you could also fire an event "BALL HIT WALL" and some bonus would then reset their counters etc etc.


bye,

 Jean