Spawning more than 1 enemy using every and random and every timer

luke2125luke2125 Member, PRO Posts: 225
Hi,

I'm like 90% finish with my Kindle Game, however, I've run into a roadblock, and would appreciate any help regarding the below code:

Timer - Every 5 Seconds - Run to Completion
Change Attribute - game.enemychallengerand To random ( 1, 3 )

When All Conditions Valid: Attribute.gameenemychallengerand = 1
When All Conditions Valid: Attritube.gameenemychallenge < 3
Timer - Every 0.3. Seconds - Run to Completion
Spawn Actor: underwaterchallenge1 : Front Layer, Direction: 0: Position: random (x,y), Position random (x,y) Relative to Actor


In underwaterchallenge1: I have Change Attribute: game.enemychallenge to game.enemychallenge+1, and the rest of the movement behaviors....Just like enemychallenge 1 and enemychallenge 3 which equals 3, hence random ( 1,3)

Now, I'm trying to randomly spawn 3 actors every 60 seconds, but coming from different directions. Ex: if enemychallengerand =1 then spawn that actor, if =2 spawn that actor. However, this code is not working. I have the spawner on the scene ( not visible on the scene ). Would appreciate any help regarding this....Thanks and God Bless....

Sincerely,

Sunday

Comments

  • luke2125luke2125 Member, PRO Posts: 225
    Bump.....Any suggestions? Thanks and God Bless....
  • SocksSocks London, UK.Member Posts: 12,822
    Timer - Every 5 Seconds - Run to Completion
    Change Attribute - game.enemychallengerand To random ( 1, 3 )
    Ok, so every 5 seconds this attribute is changed to a random number between 1 and 3.
    When All Conditions Valid: Attribute.gameenemychallengerand = 1
    What is this, another rule ? Maybe it's a rule that is nested inside the timer ?
    When All Conditions Valid: Attritube.gameenemychallenge < 3
    Same question here, what is this, another rule - or has it got something to do with the last rule, perhaps another condition for the first rule ? And why is it checking whether the attribute is less than than 3 (1 or 2) ?

    . . . . etc etc

    Basically the question is a little confusing, is there any way you could make it a little clearer ?
  • luke2125luke2125 Member, PRO Posts: 225
    Hi Socks,

    Thanks for the quick response and help, but I figured it out, I was missing the following:

    Change Attribute: game.enemychallenge to 0. In other words, I had to reset this attribute so it will begin to spawn again, since I have a Rule - > Change Attribute: game.enemychallenge < 7, so it was doing it the first time, spawning the enemies, but only once. Now, it's working like it's supposed to. Sometimes in a game, the most simple thing is what's missing....Thanks again for your help and God Bless.....

    Sincerely,

    Sunday
Sign In or Register to comment.