Multiple Missiles
Multiple Missiles
I’ve become very confused trying to imagine how to make a ship that would fire multiple missiles in BASIC. If you could fire multiple missiles from one location, or from various locations as you moved left and right, how would you even keep track of them all to keep them travelling up the screen?
Re: Multiple Missiles
make arrays where you keep coordinates and direction like this with max 5 simultaneously
dim y(5)
dim x(5)
dim d(5)
then in a loop add new or delete old missiles and move them
however I suspect that the game will become slow. better try coding assembler
dim y(5)
dim x(5)
dim d(5)
then in a loop add new or delete old missiles and move them
however I suspect that the game will become slow. better try coding assembler
Re: Multiple Missiles
Thank you! I was thinking an array must be involved somehow, but I couldn’t think how.
As you say, probably not something I’d use in the real world, but I just couldn’t think how it could be done.
When using machine code on the ZX81 would there be a limit to how many missiles and enemy missiles could be used simultaneously?
As you say, probably not something I’d use in the real world, but I just couldn’t think how it could be done.
When using machine code on the ZX81 would there be a limit to how many missiles and enemy missiles could be used simultaneously?
Re: Multiple Missiles
Definitely not more than the number of characters per screen
768?
768?
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: Multiple Missiles
That would be a busy screen ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Re: Multiple Missiles
Speed will play a role then. It takes time to calculate the moving missiles.MrVertigo wrote: ↑Mon Jul 17, 2023 12:23 pm Thank you! I was thinking an array must be involved somehow, but I couldn’t think how.
As you say, probably not something I’d use in the real world, but I just couldn’t think how it could be done.
When using machine code on the ZX81 would there be a limit to how many missiles and enemy missiles could be used simultaneously?
Memory is another.
See LUNAPARK81. I move 20 persons in 1K
or better see my game where you must capture 20 moving dots to see about speed.
https://www.sinclairzxworld.com/viewtop ... ots#p49692
Re: Multiple Missiles
I will study them with interest!