|
Post by tomasiano74 on May 15, 2023 16:33:53 GMT
Hello, I have limited programming knowledge and I'm starting with this wonderful program. I've encountered an initial problem that I haven't been able to solve. I would like the bullets to be fired one by one and be depleted, for example, after 6 shots. How could I do that? Thank you very much.
|
|
|
Post by oss003 on May 16, 2023 18:30:33 GMT
Hi, you can use a variable as bullet counter. If a bullet is fired, increment the counter and if it's 6, skip firing.
Greetings Kees
|
|
|
Post by tomasiano74 on May 16, 2023 23:44:19 GMT
Thank you very much, this is the code that is not working. I use F to have only one simultaneous shot on the screen, however, the counter B is not working because it keeps shooting after the sixth bullet.
LET B = 6 IF KEY FIRE2 IF B > 0 IF F = 0 IF DIRECTION = RIGHT ADD 16 TO X SPAWN 2 4 SUBTRACT 16 FROM X SUBTRACT 1 FROM B LET F = 1 ELSE SUBTRACT 16 FROM X SPAWN 2 4 ADD 16 TO X SUBTRACT 1 FROM B LET F = 1 ENDIF ENDIF ELSE LET F = 1 ENDIF ENDIF ENDIF
|
|
|
Post by tomasiano74 on May 17, 2023 0:15:35 GMT
I have already solved it. I have put "LET B=6" in EVENT GAMEINIT. Thank you very much.
|
|
|
Post by xavisan on Dec 7, 2023 15:42:16 GMT
I have already solved it. I have put "LET B=6" in EVENT GAMEINIT. Thank you very much. If you use the LET B = 6 in GAMEINIT event, don't use LET B = 6 in the Player o Sprite event, exept if exists any exception.
|
|