limit spawn actor

Reigiv4sReigiv4s Member Posts: 27
edited April 2012 in Working with GS (Mac)
i create the next follow:
#How meany - integer#

-Cannon-
*Rule*
Attribute - game.how meany - < 1
(Rule
Actor receivens event - mouse button is down
Spawn Actor
Actor :Ball )

-Ball-
change Attribute - game.howmeany... to game.how meany+1

Accelerate
Direction :0 relative to:actor
accelerate:500

-Trap-
*Rule*
Actor receivens event - overlaps or collide with actor of type Ball
Change scene..

The problem is when reset scene cannon does spawn the ball..what a mising ?
when change a scene same happen cannon does spwan the ball.

Best Answer

  • GreenHavenGamesGreenHavenGames Posts: 62
    Accepted Answer
    I'll have a stab. I see two questions here. 1) How do you limit the spawning of your "ball" actor. 2) How do you make the "cannon" spawn again after a scene change.

    1) This is already in place by changing the "ball_alive" variable to "true". The problem that I see is that both the cannon and the ball have the Spawn attribute inside it. Remove it from inside the ball actor.

    2) In the Trap actor, before the change scene, place a Change Attribute and change "ball_alive" back to "false" Make sure that anything that either destroys the ball or changes the scene also changes the "ball_alive" attribute.

    Good luck

Answers

  • jckmcgrawjckmcgraw Member Posts: 647
    I got completely lost reading that. Could you explain it again clearly? Sorry.
  • Reigiv4sReigiv4s Member Posts: 27
    I have made a game with the normative rule throws a ball and the ball must fall in a right place .. if you fall into the wrong point of the game starts from the beginning .. and generally not Throw the ball again .. He stuck me. I can not understand that I have done wrong with the code....the 1 post explain step by step what have a create..if you create this follow a new project you see what i mean... i can explain it more clearly :( my eng is not good. sorry
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    When you change scene, does the cannon spawn a ball:
    (1) immediately
    (2) when you press the mouse button
    (3) never

    Without knowing the answer to that, I can suggest the following:
    (a) Try resetting game.howmeany to 0 when the scene starts
    (b) Type in your native language and post your question here again

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Reigiv4sReigiv4s Member Posts: 27
    when i change scene, does the cannon spawn a ball when i press the mouse button ..
    same happen when reset scene...only work when i use reset game..oO

    scroll up and check the actors what have inside.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    when i change scene, does the cannon spawn a ball when i press the mouse button
    Your English is a bit hard to understand. I was hoping you would pick 1, 2, or 3 from my question. I'm going to assume you mean 2.

    Please post a screenshot of the rules you have so that I can help you further, or post a link to your gamefile.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Reigiv4sReigiv4s Member Posts: 27
    ty alot its work..:)
Sign In or Register to comment.