Working on 2D Game. How do a spawn an actor forever ?

timbojilltimbojill Member Posts: 13
edited February 2012 in Working with GS (Mac)
Need some help. I have an actor who's coordinates are x: 26.73828, y: 250. The width of the object is 55 and the height is 56. I am the object accelerating downwards. When the object clears it space I want it to spawn the very same object over and over agian. Can some please help.

Comments

  • POMPOM Member Posts: 2,599
    You can't spawn actors forever , it will crash your game..
    What are you trying to achieve ?

    Roy.
  • timbojilltimbojill Member Posts: 13
    I have an actor accelerating downwards. When the actor clears the space it was in I want it to spawn the same actor agian. Please help.
  • POMPOM Member Posts: 2,599
    edited February 2012
    To literally do what you want simply make a timer in your actor :
    Every 0.1 sec
    spawn actor "your actor's name"

    BUT LIKE I SAID IT WILL KILL YOUR GAME !

    Are you trying to make a trail effect?

    Roy.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited February 2012
    In the scene attributes, click the checkbox for Wrap Y, it will drop off the bottom of the screen, and then re-appear at the top.

    Or do you want another to spawn at those same coordinates?
  • timbojilltimbojill Member Posts: 13
    Ok here is my problem. I have an actor that starts in x: 26.73838, and y: 250 coorindinates on the screen. The width and height are 55 and 56 respectively. The the actor moves and clears the space I want to spawn the sane actor in the sane x and y coordinates as above. The have the actor set to fall of the screen.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited February 2012
    At the bottom, have a blank actor below the play screen. And in the main actor, have a rule that says, when overlaps or collides with blank actor - change attribute self.position X to 26.73838 and another change attribute self.position Y to 250. That will just recycle the same actor over and over without having to spawn. You can add other rules and such for scoring or whatever as well.

    Is that what you need?
  • POMPOM Member Posts: 2,599
    edited February 2012
    I made this quick template for ya , i believe this is what your after..
    http://www.mediafire.com/?0m9ird94xhk465f

    EDIT:
    Just saw SlickZero's comment , basically its the same as what i did in the template.. ;)

    Roy.
  • timbojilltimbojill Member Posts: 13
    I am in my cell phone will test out code when I reach home
  • timbojilltimbojill Member Posts: 13
    This is almost what I needed. I will try to mod this to my linking
  • timbojilltimbojill Member Posts: 13
    edited February 2012
    Is it necessary to have the indicator actor in the project ?
  • timbojilltimbojill Member Posts: 13
    How do I make the actors spawn closer together in the example you gave ?
Sign In or Register to comment.