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 / invisible sprite

Author
Message
x3meblue
16
Years of Service
User Offline
Joined: 11th Dec 2008
Location: Nuremberg, Germany
Posted: 17th Dec 2008 15:52
Hello!

Is it possible to make one invisible sprite, so you can see the background through, but still have collision with this sprite?

greetz

Back to the Basic Roots - Dark Power Inside
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Dec 2008 16:50
will it still detect collision if you hide it?
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 17th Dec 2008 16:52 Edited at: 17th Dec 2008 17:14
Just started up DBC.. Sprite detection will work if the image is not all rgb(0,0,0) and HIDE SPRITE is used.

I don't Adam and believe it!
x3meblue
16
Years of Service
User Offline
Joined: 11th Dec 2008
Location: Nuremberg, Germany
Posted: 17th Dec 2008 16:57
Hi!

no, for make it more clear, i mean it this way:

i have one map for a 2d rpg as background and for
the collision dectection i want use one big sprite
in the shape of the map, that the ways you can pass are free and the places where the player can not go will be checked with the sprite collision. For the player still see the map normal the
sprite must be unvisible.

greetz

Back to the Basic Roots - Dark Power Inside
Robert The Robot
18
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 17th Dec 2008 17:03 Edited at: 17th Dec 2008 17:09
You'll need this command:
SET SPRITE Sprite Number, Backsave, Transparency

Set transparency to one to make all pixels coloured black (RGB(0,0,0)) invisible, so whatever is behind them will show through. Keep backsave at 1, or the sprite will leave a trail when it moves.

Make your sprite an exact clone of you main map, but for your sprite image, colour the acceptable roadways black (RGB(0,0,0)). Use this new image as a transparent sprite, and check it for collision.

Hope this helps!

[Edit] You must have posted while I was typing I've edited the above part to make more sense based on your new post.

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
x3meblue
16
Years of Service
User Offline
Joined: 11th Dec 2008
Location: Nuremberg, Germany
Posted: 17th Dec 2008 23:35
hey, thank you!

this is what i was looking for!

Back to the Basic Roots - Dark Power Inside

Login to post a reply

Server time is: 2025-06-07 20:20:58
Your offset time is: 2025-06-07 20:20:58