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.

DarkBASIC Discussion / transparency detection

Author
Message
Mr Inquisitive
20
Years of Service
User Offline
Joined: 5th Feb 2005
Location: Who Cares?
Posted: 26th Apr 2005 06:43
is it possible to make it so that it doesn't detect for collision with transparent parts of a sprite. If so, how? Also, while on the topic, how would i make it so that it only detects collision for a sprite if it is shown. should i make a variable and say "if spriteshown4=0 and sprite collision(1,4)=1 then etc.?

Horus Game Developments
freewebs.com/horusgames
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 26th Apr 2005 07:28 Edited at: 26th Apr 2005 07:29
Mr Inquisitive,

Unfortunately, there is no command which enables DarkBasic to detect collision only on the non-transparent parts of a sprite. It would take a bit of your math skills to create this type of collision yourselve, based on specific angles. Is your sprite image a circle, to where the collision needs to take place when something is accually within the area of the image of the circle?

About detection of a sprite only when it is shown, you would simply create a variable that turns 'on' and 'off' with the changing of the sprite from 'on' to 'off'. When you hide the sprite, just make sure that the variable is set to a specific number, so it can be referanced to as 'on', and when shown vice versa. Remember the word "Boolean", one of the greatest fundamentals in programming.




+NanoBrain+

Login to post a reply

Server time is: 2025-05-23 15:23:50
Your offset time is: 2025-05-23 15:23:50