# sprite collision

Pagina 3/5
1 | 2 | | 4 | 5

hey viejo, nice job! I realised it's for MSX1 .. and that the player sprite already uses more sprites.. how are you going to handle all the sprite-flickering? Some intelligent algorithm to prevent having too many sprites on a row ?

yes!

I hope you'll be able to finish this game viejo!

If you continue testing collision things just post your results for us to know! , and thnx!

Wolf_: yes, the spaceship has 2 sprites on a row... I'll manage the sprite thing on RAM in order to rotate the sprites after displaying them when the 5-sprites-in-a-row happens. I talked about this matter with BiFi, who helped me in how I must face the problem. I made some tests and the flickering is low!.

I realised it's for MSX1

of course

Why not ALWAYS rotate sprites. no need to check if 5 sprites are on a row (no checking needed) shift sprites on every frame and you'l do fine.
and don't forget the power of CHARS

Why not ALWAYS rotate sprites. no need to check if 5 sprites are on a row (no checking needed) shift sprites on every frame and you'l do fine.
and don't forget the power of CHARS

ok ro, it's true

Don't know if this will help, but that's the routine I usually use to check collision beetween two rectangles:

function Collision(x1,y1,w,h,x2,y2,w2,h2:byte):boolean;
begin
Collision:=false;
if (x1<x2+w2) and (x1+w>x2) and (y1<y2+h2) and (y1+h>y2) then Collision:=true;
end;

x1,y1: coordinates of first rectangle
w,h: width and height of first rectangle
x2,y2: coordinates of second rectangle
w2,h2: width and height of second rectangle

This routine is pretty simple and works well, and should be very easy to port it to ASM

Slotman, that one purely works on rects .. many player sprites aren't exactly rect .. a typical shooter-shit is somewhat like a triangle.. and many (bigger) bullets are appraching a circle ..

so.. nice try .. but I don't think it's useful

for that there is a trick...

just do smaller the squares... or do customizes squares depending of the Graphics that you uses....that combinated with the fact of: that the tests are done alone after of get a sprite collision from the VDP... most of the time it will works.

But that depends of the game itself

What about, if a v9938 is detected, let the game run in screen 4 instead of screen 2 in order to reduce sprite flicker for MSX2 owners? I don't know how difficult that would be, screen 2 and screen 4 are pretty similar and afaik most of the difference lays in the sprites, but... well, it's a thought.

~Grauw

Pagina 3/5
1 | 2 | | 4 | 5