Another spawn problem

kidd717kidd717 Member Posts: 3
edited November -1 in Working with GS (Mac)
Hello all,
I'm designing a game where there is one actor off the left side of the stage. The actor will go across the screen and off the other side. If the actor is touched I want the actor to destroy and another actor to spawn from the same location and move again across the stage but at a faster speed. I am trying to get it so that every time the actor is destroyed another actor spawns and goes faster than the previous actor up to 4 times. Can't figure this spawn thing out. please help me. It's the last thing I need to complete the game.

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Are you having problems with the actual spawning, or with the new actor going faster?

    If it's the faster thing, you just need to have the movement speed set progressively higher for actors 2, 3, and 4 that spawn after the original actor gets destroyed. If it's a problem with the actual spawning, then a little more info on what is happening may help.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Ok this is what i'm understanding your actor moves across the stage and on touch destroys and a new actor spawns at the starting point again right? and then move across faster. Try this.

    When touch is pressed
    --Change attribute self.position.x to (what ever your starting point is
    --Change attribute self.image to (what ever your new actor image needs to be)
    --Change attribute self.linearvelocity.x to self.linearvelocity.x + (start with 30 or so and play with the number from there)

    THis type or recycling should give you better performance than destroying and spawning.

    Goog luck
  • kidd717kidd717 Member Posts: 3
    Hey guys thanks for helping. Slick Zero I'm having problems with both and I can't understand why the spawned actor won't destroy when it is touched. Tenrdrmer I'm going to try that now and I will post the results. Thanks for the help guys I appreciate it.
  • kidd717kidd717 Member Posts: 3
    Ok tenrdrmer that works pretty sweet. There is just one thing I forgot to mention. My Actor has a sensor so that it has to be touched in a specific spot. How can I tell the sensor once it's touched to do what you suggested to the actor?
Sign In or Register to comment.