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! / Sprite collision with background image??

Author
Message
GSX
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 9th Mar 2003 20:19
To start with, thanks for looking at this... =)

I got stuck on a problem trying to make a sprite collide
with a background picture...

I want to be able to load background maps made by images to
make it easy to load a new map and check collisions against
background image regardless of image structure.

If you download my source and try it out I want the black
colour to NOT generate a collision, BUT if you hit the green
sides (or what ever colour it uses) in the image there
should be a collision. How is this done in an easy way?!?

My source is located here:

http://gsxr.bjexa.com/Game.rar
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 12th Mar 2003 04:20
My first thought would be to use the point(x,y) command.

Return Value=point(x,y)

the x,y correlate with a point on the sprite that you want to detect collision with. Depending on the size,shape,and precision that you need, you may have to change the point depending on the direction of your sprite. (I didn't download your code, so I don't know exactly what you need). If the sprite is fairly small and you don't require high precision you can keep track of the center of the sprite.

GSX
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 14th Mar 2003 18:46
Thanks, I'll try it and see if it works for me.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Mar 2003 15:07
Sorry, I don't have anything capable of reading RAR files.

If you can email me with a ZIP of this, I'll adapt the sprite collision routine I have to detect background collisions.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 15th Mar 2003 16:22
What ? You dont have WinRar ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Mar 2003 00:33
Nope. Up until now, winzip's handled everything I needed it to.

Login to post a reply

Server time is: 2024-04-24 06:31:18
Your offset time is: 2024-04-24 06:31:18