Vector bullets and sprite collision with a cell


CLIGUI 2024-01-11 16:00

I am working on a game with a scrolling movement system and vector bullets. But I can’t figure out how to make the bullets shoot one at a time instead of shotgunning.
Below is the prototype.

Later down the line I want to make the bullets change cells.

Immediate Goals:
-Shoot one shot per tap of button B
-Make it more realistic by hiding the bullet sprites until fired

Long term Goals:
-change cells hit by bullet to empty
-Add enemy’s
-make some cells act as walls

McPepic 2024-01-11 16:12

Is this what you’re looking for?

CLIGUI 2024-01-11 16:13 (Edited)

I tried it but same shotgunning problem. It does fix the bullet looking like it is floating in front of the character though

McPepic 2024-01-11 16:27

So wait, is it too fast then? You could use a timer.

CLIGUI 2024-01-11 16:30

It’s not the speed. I want only one sprite to be shot at a time, I will try using a timer

McPepic 2024-01-11 16:33

That’s because you’re looping through all of the bullets and setting all of them to fire when the button is pressed. You could maintain a queue of unused bullets. The way I handled it in my Doodle Jump clone is by selecting a bullet based on the value of the program timer.

CLIGUI 2024-01-11 16:41

I see. I looked at the version of Doodle jump where you added the projectiles and will study it for a while.

was8bit 2024-01-11 17:53 (Edited)

This one might be helpful with scrolling ...


Original code


CLIGUI 2024-01-15 16:42 (Edited)

I found this weird pallet change, notice that this specific pallet does not exist. It appeared after I placed a cell in the upper most left corner of the background and saved it. It also made the hexadecimal part of the pallet much larger and the same as the background.

Cells.nx | Open in app
2024-01-15 16:42

McPepic 2024-01-15 17:00

You saved a background to the ROM used by default for palettes. The program is trying to interpret background data as palette data.

Log in to reply.