Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Restrictions on sprite size for Sprite Hit?

Author
Message
Gel douche
20
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 16th May 2003 18:33 Edited at: 16th May 2003 18:36
Hi

Is there some kind of restriction on the size of the image you can check sprite hit against?

I'm making a platform game and what i was attempting to do was to create a couple of platforms in one to walk on. I created one long bmp with a large black section dividing the image up into two when transparency is applied. The problem is the character just walks accross it when checking it with sprite hit even though theres quite a gap between player sprite and platform.

I'm using simple gravity code at the moment -

if sprite hit (1,4)
gravity# = gravity# - gravity#
else
gravity# = 3.5
endif

the black part is rgb(0,0,0) on both platform and player backgrounds.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th May 2003 20:21
Sprite collision in DBPro does not take account of transparent areas - as far as collision is concerned, a sprite is a solid rectagle the size of the image you are using.

For this purpose, I would simply break the single sprite into two sprites with a gap between them.

For more accurate work, I have a pixel-perfect sprite collision routine that can be used - but it does slow things down - not too drastically though.
Gel douche
20
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 16th May 2003 21:48
I see now thanks for your help.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 17th May 2003 03:36
It should be posted very large at the top of the forums "DBPro sprite collision DOES NOT use transparency, IT IS NOT PIXEL PERFECT COLLISION." because this question has be ask so much here recently.
Gel douche
20
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 17th May 2003 14:02
This forums was months in beta yet the only features that appear to have been added are the code buttons, standard bbs features such as last post and a search option have gone. It was only recent that the edit function worked.

I'm sorry if you're sick of people asking this, i guess it should be made clear in the reference manual then.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th May 2003 14:14
Not me - it gives me a chance to meet new people

Login to post a reply

Server time is: 2024-04-25 14:51:09
Your offset time is: 2024-04-25 14:51:09