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 Professional Discussion / Sprite Collision()

Author
Message
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 19th Jul 2003 02:15
I've always had a problem getting this to work, and I can't figure out why. Can anyone give me some sample code (that they know works for a fact)? Or possibly some download locations with samples? Thanks. If I don't, then I have to do the collision manually, which sucks horribly.
SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 19th Jul 2003 05:55
Due to the lack of responses I'll now assume that the Sprite Collision() command does not function properly.

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 19th Jul 2003 06:16
You need to wait a day at least for a few responses, especially when you post in the middle of the night.

The sprite collision does work but in dbpro it is not pixel perfect. It uses the plains the sprite image is on so either use square sprites or use your own methods.

See code for example
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 19th Jul 2003 07:06
I didn't post in the middle of the night, I posted earlier this evening. I know that the sprite collision is not pixel perfect as well, and I have been using my own methods. By the way, I've tried everything using the code, include just printing text that says "Hey! The sprites have collided!". No such luck. I'll try your code though. Thanks.

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 19th Jul 2003 07:09
Oddly enough, it worked. I must just be a total moron. Lol.

Another question. If I were to scale the sprite, would the plain be scaled as well?

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 19th Jul 2003 18:19
Yes the plain is scaled as well.
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 20th Jul 2003 02:07
That's odd. If that's true, then in that case would that not mean that the X and Y positions are moved to the center of the now scaled sprite? That can't be the case then, because my collision code would be working and I wouldn't be having this problem. Oh well, thanks anyway winch.

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
Eric T
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location: My location is where I am at this time.
Posted: 20th Jul 2003 02:42
Quote: "I didn't post in the middle of the night, I posted earlier this evening."


tis 6pm in the uk when you first posted, so they are getting ready to eat food, then when you next posted peole coulda been programming or sleeping

Opinions are like a$$holes, Everybody has one.
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 20th Jul 2003 03:01
The scaled sprite uses x,y in the same way as before it was scaled. The top left point of the sprite stays the same and the bottom right point move accoringly.
see code.
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 20th Jul 2003 08:17
I don't need to "see code" ...i'm not a baby i just didn't know how to do this...

haha...

thanks again

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!

Login to post a reply

Server time is: 2026-07-21 12:49:56
Your offset time is: 2026-07-21 12:49:56