Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, AndrewAMD, Ayumi), 750 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2D Collision? #444813
08/19/14 11:57
08/19/14 11:57
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Hey!

In one of my current 'projects' (it's more like playing around with new stuff) I'm using 2D sprite graphics and I really need some kind of collision system.

Has anyone got some information (examples/tutorials) on how to code a 2D collision system, or any idea how I could solve this problem?

kind regards, Kartoffel laugh


POTATO-MAN saves the day! - Random
Re: 2D Collision? [Re: Kartoffel] #444814
08/19/14 12:03
08/19/14 12:03
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i would use a 2d physics engine like box2d or chipmunk. then you don't only get collision detection but nice physics too. laugh

i think chipmunk uses a c-api so maybe it is directly usable with lite-c.

Re: 2D Collision? [Re: ventilator] #444815
08/19/14 12:04
08/19/14 12:04
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
oohh, why didn't I notice this, thanks a lot ^^'

afair, someone coded a box2D wrapper for the AUM-contest some time ago, I'll have a look at it laugh

Edit: yep, here it is grin

Last edited by Kartoffel; 08/19/14 12:10.

POTATO-MAN saves the day! - Random
Re: 2D Collision? [Re: Kartoffel] #444964
08/24/14 11:21
08/24/14 11:21
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
jip I guess it depends on your needs , the one I did
with per pixel collision pretty much would do for
any kind of 2d collision detection if rotation
were apart of the check,of a sprite based game .

mine is a bit like "sonic the hedgehog" .

no physics though ,only detection of pixel intersections .

I have been looking at the marching squares algorithm for finding the outline of objects in images
wich could then be used to form physical bodies with
in libraries such as the above mentioned physics libraries .

that would enable me to turn 2d drawing into physical objects .

having the outline also enables a lot od other useful functionality .

but any way ,good luck and enjoy .


Last edited by Wjbender; 08/24/14 11:25.

Compulsive compiler

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1