Actor stop spawning after touch, restart spawning after contact with another actor, HOW?
Just like the title says, so I click my actor 1 that spawns another actor, after the first touch I want the first spawn actor to deactivate, which means I want it to stop spawing actors, not clickable, and once the other actor hits the ground I want the spawner to activate again and be able to spawn more actors again.
Any help?
Any help?
Comments
gameAttribute: spawnDone … boolean type
on actor1:
Rule: when (All)
Event: touch is pressed
Attribute: when spawnDone is false
-Spawn actor2
-changeAttribute: game.spawnDone To: true
on actor2
Rule: when
Event: overlaps or collides with actor type ground
-changeAttribute: game.spawnDone To: false
add gameAttribute … spawnCount … index type
on spawnerButton
Rule: when (All)
Event: touch is pressed
Attribute: game.spawnCount < 5
-Spawn
-changeAttribute: spawnCount To: spawnCount+1
on ballActor:
Rule: when
Event: touch is pressed (whatever triggers the destroy of ball)
-changeAttribute: game.spawnCount To: game.spawnCount-1
-Destroy
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
and do not change the spawnCount with the touch/destroy ball
track the number of balls destroyed with another attribute
have that attribute … restart the spawn (changeAttribute: spawnCount To: 0)
the idea is to do the as many spawns as you want on screen
destroy the balls (and track # of balls destroyed)
restart the spawns
you tell the computer when to do something
(attributes for conditions to trigger)
you tell the computer what to do
(attributes for tracking that is done)
maybe something like when the destroyCount = 4
changeAttribute: game.spawnCount To: 1
will restart the spawn?