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.

AppGameKit Classic Chat / AABB Collision Detection in AGK2?

Author
Message
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 1st Dec 2017 17:13
I can easily do collision detection on both sides of an object(left,right or up,down), but I can't seem to do it for all sides. An AABB collision example in for AGK2 would help(Player vs block interaction, player stops when touches any side of the block, but can still slide). I don't mind pseudo-code either, I just want to know how AABB collision would work in this situation.
I love games, who doesn't?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Dec 2017 19:21
i made an example for you.
the slide trick is that you try moving x and y in sequence, and not together.

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 1st Dec 2017 21:32
Quote: "i made an example for you.
the slide trick is that you try moving x and y in sequence, and not together."


Thank you so much. I am impressed at how you're able to create code like this, but I am also disappointed of how I can't even write code of that magnitude. If there's a guide you've followed to understand and write stuff like this, then it would be nice of you to link it.
I love games, who doesn't?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Dec 2017 22:38
its daily experience
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 1st Dec 2017 23:16
Markus is pretty good at dropping coding bombs like this

I've adopted a method for 3D collision detection where I use a system like mocap balls on the extremities of an object and use them for collision.
This is more complex to set up, but gives good collision detail.

I'll have to study Markus's example to see if it can be adapted to 3D.
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 2nd Dec 2017 23:01
Quote: "its daily experience "


Looks like I have a long way to go

Just one more thing, how do I get the position values of each rectangle?
I love games, who doesn't?
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 3rd Dec 2017 08:41 Edited at: 3rd Dec 2017 09:58
Hi

You can use the physic too or use GetSpriteCollision() like that :



I would like to get a sliding effect not with thoses "trembling", do you know how I can get the sliding effets without trembling ?
AGK2 tier1 - http://www.dracaena-studio.com
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 3rd Dec 2017 09:22
Yes, Marcus is pretty experienced!!!!
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-04-27 04:06:42
Your offset time is: 2024-04-27 04:06:42