|
Post by marasmusine on May 19, 2021 7:42:22 GMT
Hello everyone. I am new to ACD, I am slowly figuring things out, but will have a ton of questions. First question! Maybe I'm not using Main Loop correctly. I want baddies to regularly spawn. I am using variable E to count them in.
In game initialization:
LET E = 100
Then in main loop 1:
SUBTRACT 1 FROM E ; aliens
IF E = 0 LET E = 100
SPAWN 2 2
SPAWNED
X = RIGHTEDGE
Y = 4
ENDSPAWN
ENDIF here However, nothing happens in the game.
If I put this code in the Player script, the baddies do appear. However, when they spawn for a fraction of a second they appear on top of the player sprite before moving to the X Y position.
|
|
|
Post by marasmusine on May 19, 2021 10:33:07 GMT
Am I right in saying that the following post by Johnathan explains why spawning doesn't work well in the main loop? arcadegamedesigner.proboards.com/post/627In which case, maybe I should have an invisible "baddy spawning" sprite already existing on the screen, and use this to control the appearance of new baddies?
|
|
|
Post by roolandoo on May 19, 2021 18:43:27 GMT
Hello, It does work if you do it this way, for example: LET Y 4 LET X 50 SPAWN 2 2
Greetings.
|
|
|
Post by marasmusine on May 19, 2021 22:13:01 GMT
Thanks roolandoo!
|
|