spawn actors

disparitiondisparition Member Posts: 32
edited March 2012 in Working with GS (Mac)
hi, i have a problem with the spawn attribute, lets say i have actor1 and when i do a double tap actor2 appears and actor1 disappears and that goes on until actor3 but when i double tap in actor3 to go back to actor1 the game freezes , so anyone knows how to make actor1 spawn from actor3 without having the game freeze

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    If the game is freezing you have some bad logic in your spawn actor one code. Reverifiy everything
  • disparitiondisparition Member Posts: 32
    i am sorry maybe i didnt explain myself well. i have 4 actors lets say actor 1,2,3 and 4 and what i want to do is that when i double tap actor 1 actor 2 appears and so on until you get to actor 4 and then spawn actor 1 again to get the cycle start all over (i do it with 2 taps because i also want to be able to drag and move the actors by holding them down) but the problem is that when actor 1 spawns from actor 4 the game freezes and when you double tap actor 1 it doesnt spawn actor 2, the way that i have my codes are:

  • disparitiondisparition Member Posts: 32
    i create 4 different game attributes integers (tap1, tap2, tap3, tap4)
    ACTOR 1
    > rule
    --- ACTOR receives TOUCH is PRESSED
    -constrain attribute-- game.tap1-to-game.tap1+1
    -otherwise-- timer --AFTER .5s --game.tap1-to-0

    >rule
    --ATTRIBUTE - game.tap1 = 2
    --destroy this actor
    --spawn actor 2 in the place of actor 1

    and so on for the other actors until it reaches actor 4
    ACTOR 4
    >rule
    --- ACTOR receives TOUCH is PRESSED
    -constrain attribute-- game.tap4-to-game.tap4+1
    -otherwise-- timer --AFTER .5s --game.tap4-to-0

    >rule
    --ATTRIBUTE - game.tap4 = 2
    --destroy this actor
    --spawn actor 1 in the place of actor 4

    and then the game freezes with actor 1
Sign In or Register to comment.