playMaker

Author Topic: kill cubes and restart, help  (Read 1643 times)

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
kill cubes and restart, help
« on: October 09, 2015, 08:52:58 PM »
I have 10 cubes that have to be kill in 20 seconds, how can i do to kill them all, and load the next scene, but if not kill all the 10 cubes in 20 seconds, reload the same scene and continues with the amount of cubes left.

i need to tell playmaker there is no more 10 cubes, so go to the next scene

the cuber are tag as enemy

how can i build that with playmaker
« Last Edit: October 10, 2015, 03:50:55 AM by nabilfx »

terri

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • terrivellmann.tumblr.com
Re: kill cubes and restart, help
« Reply #1 on: October 10, 2015, 05:00:00 AM »
Have a Gameobject at the scene that:
- starts by setting an INT to 10
- counts down from 20 seconds and when that is up it restarts the scene
- everyframe compares the INT to 0, and if true, triggers WIN state

Now on the cubes, when they die, they subtract 1 from that Gameobject's INT variable

Its pretty simple so avoided using Arraymaker and stuff but there would be many ways to do it

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: kill cubes and restart, help
« Reply #2 on: October 10, 2015, 05:19:00 AM »
this first (starts by setting an INT to 10), i create a variable INT with Int value of 10?

this second(counts down from 20 seconds and when that is up it restarts the scene) is a Int compare?

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
    • View Profile
Re: kill cubes and restart, help
« Reply #3 on: October 11, 2015, 05:27:18 AM »
you can do the timer with a single state that has a Wait action that sends event "Level End" when it completes..

and then in the same state as the wait action, have an int compare that checks your number of cubes INT against 0 - if its equal or less than zero, send event "Win"

Then you can connect those events to new states that do whatever you want to happen when the player loses or wins

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: kill cubes and restart, help
« Reply #4 on: October 11, 2015, 06:44:50 AM »
I am having trouble connecting this game, I have 3 lives and 20 seconds to kill 10 gold bars at level 1. If killing four gold bars in 20 seconds, it restarts in the same scene and take a life. Then would have two lives in 20 seconds, there can kill the remaining six gold bars in less than 20 seconds, there jumps to level 2, and so up to the level 3. And finish the game.

each gold bar worth 44 point

Each level 1 score points, have to keep at level 2 and 3.
If you lose 3 lives at any level ends the game.

I ned help please.

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: kill cubes and restart, help
« Reply #5 on: October 12, 2015, 05:16:34 AM »
How can i add a INT variable to the cube Obj.

terri

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • terrivellmann.tumblr.com
Re: kill cubes and restart, help
« Reply #6 on: October 12, 2015, 05:27:09 AM »
have you gone through the basic tutorials? they are very helpful when you're starting out

I'd create an empty gameobject and create an FSM with the gameloop on it, including all the variables (time, score, level)