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.

Newcomers DBPro Corner / 2D Collision

Author
Message
The Grim Reaper
16
Years of Service
User Offline
Joined: 29th Sep 2007
Location: USA
Posted: 29th Sep 2007 19:08
Hi, I just purchased DBpro a couple of weeks ago and have been working with 2D lately and was wondering if somebody can show me an example of how to do collision in 2D. For example a platformer, how can I make it so that the player collides with the platform.

Thank you very much.
Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 29th Sep 2007 23:38


Our home is our world, our life, home is our world...
Homeworld: The ladder
The Grim Reaper
16
Years of Service
User Offline
Joined: 29th Sep 2007
Location: USA
Posted: 29th Sep 2007 23:48
Shut the fvck up, u could said it in a non-sarcastic manner.
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 30th Sep 2007 00:12
Yeha noob.

But anyway, it depends if you want ppcolision, square collision, tile collision, bullet speed collision, Elliptical Collision, Smart Collision, ANDed Collision, Polygon Collision, Vector Collision, Linear Collision, Collision that gives input besides hit and not hit, Bitmap Collision, Color-based Collision, Invisible Image Collision, or Incoming Data Collision(lol)

Oh and, if you do a SEARCH, an answer will be found.

Your signature has been deleted by a moderator because this joke is getting old.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Sep 2007 00:27
You guys are way too harsh on a guy who only joined today

Grim Reaper,

Collision is 2D is quite hard. It requires some mathematical skill, but as aluseus put it, it depends on the kind of collision you want.

You may want to have simple box collision, which really, is just a few IF statements, i.e. If posx > boxx - box_size and posy > boxy - box_size etc etc...

If you want to take it to another level, you could borrow concepts from 3D Collision, and try some Raycasting. That is basically intersection of two lines. I believe a guy here called RUCCUS made a very nice example of how to use it. Do a search in the Code Snippets forum for Line Segment and you should find something.

If you really want to take it seriously, and have full on collision, physics, etc, you should try Fizz. It's basically a function set that uses a plugin called Newton for 2D Collision. Search in the Work In Progress forum for Fizz, and also I think you should download the Newton wrapper for it to work.

Good luck

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 30th Sep 2007 01:01
Yeha noob was sarcasm, but obviously didn't translate too well.
But really, he should search first I did so when I first joined.

Oh BOX2D is pretty good too for physics.

Your signature has been deleted by a moderator because this joke is getting old.
The Grim Reaper
16
Years of Service
User Offline
Joined: 29th Sep 2007
Location: USA
Posted: 30th Sep 2007 01:59
Quote: "You guys are way too harsh on a guy who only joined today

Grim Reaper,

Collision is 2D is quite hard. It requires some mathematical skill, but as aluseus put it, it depends on the kind of collision you want.

You may want to have simple box collision, which really, is just a few IF statements, i.e. If posx > boxx - box_size and posy > boxy - box_size etc etc...

If you want to take it to another level, you could borrow concepts from 3D Collision, and try some Raycasting. That is basically intersection of two lines. I believe a guy here called RUCCUS made a very nice example of how to use it. Do a search in the Code Snippets forum for Line Segment and you should find something.

If you really want to take it seriously, and have full on collision, physics, etc, you should try Fizz. It's basically a function set that uses a plugin called Newton for 2D Collision. Search in the Work In Progress forum for Fizz, and also I think you should download the Newton wrapper for it to work.

Good luck "


Thanks Oh and yes I want box collision. I guess I'll go search...
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 30th Sep 2007 14:51
This may help you.

Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 30th Sep 2007 21:50
Quote: "Shut the fvck up, u could said it in a non-sarcastic manner"

Sorry, was a bit tired on that evening.

Quote: "Everyone's entitled to an opinion...but your opinions are wrong."

The Grim Reaper
16
Years of Service
User Offline
Joined: 29th Sep 2007
Location: USA
Posted: 1st Oct 2007 05:19
Quote: "Sorry, was a bit tired on that evening."


It's ok, I'm sorry for responding like that.
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 1st Oct 2007 13:15 Edited at: 2nd Oct 2007 04:12
A collision of Sprite

"SPRITE HIT()" command fails, and it is a bug.
And, "SPRITE HIT()" and "SPRITE COLLISION()" work to equal .
This bug should be repaired.
- - - - - - - -
And a collision area of slope Sprite becomes an external form.

This test program


Login to post a reply

Server time is: 2024-09-27 05:12:08
Your offset time is: 2024-09-27 05:12:08