sprite collision

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

Van wolf_

Ambassador_ (9970)

afbeelding van wolf_

14-10-2004, 12:28

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 ?

Van wolf_

Ambassador_ (9970)

afbeelding van wolf_

14-10-2004, 12:29

yes!

Van viejo_archivero

Paragon (1395)

afbeelding van viejo_archivero

14-10-2004, 12:35

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! Smile, 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!.

Van viejo_archivero

Paragon (1395)

afbeelding van viejo_archivero

14-10-2004, 12:37

I realised it's for MSX1

Big smile of course Big smile

Van ro

Scribe (4707)

afbeelding van ro

14-10-2004, 13:20

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

Van viejo_archivero

Paragon (1395)

afbeelding van viejo_archivero

14-10-2004, 13:22

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 Smile

Van SLotman

Paragon (1240)

afbeelding van SLotman

14-10-2004, 17:55

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 Smile

Van wolf_

Ambassador_ (9970)

afbeelding van wolf_

14-10-2004, 21:10

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 Smile

Van flyguille

Prophet (3028)

afbeelding van flyguille

14-10-2004, 21:22

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

Van Grauw

Ascended (10602)

afbeelding van Grauw

15-10-2004, 00:11

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