limit spawn actor
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.
#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
-
GreenHavenGames Posts: 62
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
(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
same happen when reset scene...only work when i use reset game..oO
scroll up and check the actors what have inside.
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
[IMG]http://i50.tinypic.com/14muiyr.jpg[/IMG]
[IMG]http://i46.tinypic.com/mbpkba.jpg[/IMG]
[IMG]http://i47.tinypic.com/2uyn30y.jpg[/IMG]
[IMG]http://i47.tinypic.com/2uswncw.jpg[/IMG]