GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Another spawn problem

kidd717kidd717 Posts: 3Member
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, TexasPosts: 2,870Member, Sous Chef
    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.

    I have no friends. I'm a loser that makes video games all day. Will you be my friend?

  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    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

    It's not my fault I never learned to take responsibility for anything. ;)

  • kidd717kidd717 Posts: 3Member
    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 Posts: 3Member
    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?
This discussion has been closed.