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 / Sliding collision for spites

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 23rd Mar 2003 13:49
Does any body know a way of makeing sliding collision for sprites
please help!
[img][/img]
I have a word of advice...
..don't piss on an electric fence!
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 18:14
explain sliding collision, I'm old sckool
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 23rd Mar 2003 18:23
Ouch, that's a toughie. Sprite collision isn't pixel perfect in DB either - I think you're going to have to do this mathematically, sorry.

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 18:35
I have routines for different types of collision but what exactly is "sliding" collision?
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 19:18
Ok, frobs, I found out what you younger programmers mean by "Sliding" collison, and there is many ways to do it in dbpro. But need to know what you are trying to do before posting a routine.
PiratSS
23
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Mar 2003 19:25
Ok,

I have found a way long time ago,

here:

http://www.apgardner.karoo.net/gl/collide.html

It's pretty hard when you first code it,

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
Eponick
23
Years of Service
User Offline
Joined: 18th Mar 2003
Location:
Posted: 23rd Mar 2003 22:18
Ehh, what is Sliding Collision? lol

PiratSS
23
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Mar 2003 22:21
It's math sliding collision.

It can be used basically anywhere.

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 22:24
Ok, Epodick, in my day it was just called collision. Why giving it another name I have no idea, if its not "sliding" as it is called now, what use is it? I can't think of any. Maybe some simple "Ouch, I touched it, so now I die?", can't think of any good games like that.
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 22:32
Ooops, sorry Eponick, sure wish there was an edit thingy. Typos stink.
PiratSS
23
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Mar 2003 22:33
?

What are you trying to say TRS80?

Sliding collision is a must for sommoth RTS games.

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 22:44
Yes, not using sliding collision, I cannot see any use for it, cause if you touch something you would just stop and not be able to move, I cannot see any use for the non sliding collision. So I don't know why it was given the name. But that's just my opinion. Maybe the bullet scenario, or other attack maybe, but not for player or enemy checks.
EddieRay
23
Years of Service
User Offline
Joined: 28th Feb 2003
Location: USA
Posted: 24th Mar 2003 07:15
Sliding collision is typically like a player vs. wall collision. It allows the player to move parallel to the wall, but not perpendicular. It's called "sliding" collision because it's like "sliding along a wall", the key being that any motion parallel to the wall is kept, and the rest is discarded.

For a bullet type collision or "inelastic" collision (common in the old arcade games), you don't need to worry about anything else but whether there is a "hit" or overlap of the sprites. The sprites either stick together, or they explode or game-over or whatever.

For an "elastic" collision, you need to know about the shape of the two surfaces that are colliding, the direction the objects are moving, the mass, and velocity, etc., so that you can figure out how the motion of the objects will change. A good example of a game that might use elastic collision would be a pool game. Also, if you want realistic physics for say, vehicles in a 3D game, you would take elastic collision of the wheels with the ground into consideration in your motion equations.

There are probably more collision scenarios, like a mouse on an object, or a player passing through a region of water. They would all be handled differently than a "sliding collision".

Hope this helps...

Ed

Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 24th Mar 2003 10:13
thanks everyone
i found out moy own routine while you posted these threads up but thanks a lot anyway [img][/img]
wouldn't it be great if dark basic had a command called set sprite collision on and get sprite collision x() !

I have a word of advice...
..don't piss on an electric fence!
Eponick
23
Years of Service
User Offline
Joined: 18th Mar 2003
Location:
Posted: 24th Mar 2003 22:29
Ok, so like instead of not being able to move up or down if you hit a wall to your left, you can keep "sliding" along the wall?

If thats the case, only thing ive ever used is sliding collision

HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 25th Mar 2003 06:32
Ditto. I never even heard anyone call it "sliding collision" till I came here, before that it was always just collision to me.

Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 25th Mar 2003 10:09
sliding collision is where your character is free to move at rightangles to the object you have hit.

Collision is just where it detects two objects or sprites colliding and doesnt necessarely slide the object or sprite to its old position

I have a word of advice...
..don't piss on an electric fence!

Login to post a reply

Server time is: 2026-07-11 03:37:36
Your offset time is: 2026-07-11 03:37:36