Freedom Fighter - Rise of humans *WORK IN PROGRESS*

페이지 4/4
1 | 2 | 3 |

By ARTRAG

Enlighted (6181)

ARTRAG의 아바타

27-04-2019, 10:13

thegeps wrote:

And all seems to work! Well there are some sprites sometimes that won't disappear (color1 or color2 of the same sprite) but it's almost done. I don't know why these sprites won't diasappear. the routine checks ALL sprites for collision everytime. maybe when checking second sprite coordinates are already changed (it happens during ISR)

https://youtu.be/0R9D4XmgQVw

I've not studied your code, but it seems you test collisions on each sprite layer.
If the two sprite layers belong to the same object, you should avoid to test collisions twice. It will reduce the cpu cost and avoid strange glitches as the one you see now. If the objects collide remove all sprites of the hit objects .
Even movements and logic should run once fer object, and not per sprite layer.

By thegeps

Master (207)

thegeps의 아바타

27-04-2019, 12:16

I'll try, but the sprite routine search for first free sprite when comparing with event list, so an object can be the sum of two sprites that aren't near themselves. Probably I have to add a table where I'll take trace of objects?

By thegeps

Master (207)

thegeps의 아바타

30-04-2019, 12:33

Sprites' glitches issue is solved. Now, when fired, all sprites involved disappear correctly. And it saves a couple of cpu cycles too. Thanks to ARTRAG hint now I have to do less checks, 7 instead of 20. In fact 7 is now max number of enemies on screen (14 sprites). Remaining 6 sprites are reserved for enemies' bullets. So now I check collision only with 7 objects and deactivates all related sprites

https://youtu.be/QNMPpJzCvnk

By thegeps

Master (207)

thegeps의 아바타

04-05-2019, 03:59

Aiming bullets added! Step by step I'm reaching the target Big smile
Enjoy the video (as usual set HD option on YouTube for proper framerate)

https://youtu.be/xbEGyGrE_tg

By santiontanon

Paladin (790)

santiontanon의 아바타

04-05-2019, 06:29

oh, wow, that's quickly going to get into a bullet hell! Big smile

페이지 4/4
1 | 2 | 3 |