トピック
PChicken NerdChicken

How to correctly check for sprite collision?

It appears that my sprites collide even when not touching by their bounds. Is there any way to fix this problem?
3そうだね
プレイ済み
返信[1]
親投稿
raimondz raimondzz
You can use SPCOL Management Number, Star point X, Start point Y, Width, Height to specifie the collision box.
0そうだね
プレイ済み
返信[2]
親投稿
PChicken NerdChicken
But will it really fix my problem?
0そうだね
プレイ済み
返信[3]
親投稿
PChicken NerdChicken
Also, with SPHOME being 8,8 out of a 16x16 sprite, would the bounds be -8,-8,8,8?
0そうだね
プレイ済み
返信[4]
親投稿
raimondz raimondzz
No, SPHOME only edit the reference point of the sprite. You need to call SPCOL again to generate the new boundaries of the sprite. Run this program and see it by yourself: =========================================== SPSET 0,0 SPCOL 0 SPHOME 0,8,8 SPCOL 0 OUT X,Y,W,H ? FORMAT$("X:%D Y:%D W:%D H:%D",X,Y,W,H) SPHOME 0,8,8 SPCOL 0 SPCOL 0 OUT X,Y,W,H ? FORMAT$("X:%D Y:%D W:%D H:%D",X,Y,W,H)
1そうだね
プレイ済み
返信[5]
親投稿
PChicken NerdChicken
Perhaps that is why my sprites kept colliding when not touching...
0そうだね
プレイ済み