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 / over the edge detection?

Author
Message
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 1st May 2016 15:39 Edited at: 1st May 2016 15:41
so im wondering what other people are using to detect an edge that you do not want your bad guys falling off but you do want the hero to fall off and maybe die or lose some health.

i have thought about this and i dont know what the best choice is.

the easiest way would be to build a wall object,hide it and only enable collision detection for it with bad guys.... or i need to check ground height clearances around the character and try to guide him away.

what would you guys do for this scenario...see image below.

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st May 2016 17:01
You can use Sprite Hit Groups. Allow the enemy group to hit, but not your player. You do this by setting pairs of groups that can collide with one another.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 1st May 2016 17:23
how about with 3d though? I dont know of any collision groups with 3d unless i coded such a system?
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 1st May 2016 17:53 Edited at: 1st May 2016 17:57
The 3D physics has collision groups. Use SetObject3DPhysicsGroup(). Just remember if you use collision groups you must use them for
all objects in your world.

P.S. Just noticed Paul left out part of the help for the command.
Here is the parameters.

The coffee is lovely dark and deep,and I have code to write before I sleep.
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd May 2016 00:18
ok thanks!

Ill test them out.... guess i need to build the actual fake wall first.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 2nd May 2016 10:47
Another way to do this is to have a hidden plain that sits just in front of the player and extends into the ground to the depth that you consider to be the maximum depth that the player can step down.
Then check collision detection between the plain and the ground. If there is a collision, the player can continue to walk in that direction. If not then he is at the edge of a cliff.
AGK V2 user - Tier 1 (mostly)
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd May 2016 17:07
Humm... I like that idea scraggle. If i put 2 of these infront of the characters moving direction i could probably also detect if the character could jump a hole to another platform.

Or use the same one and just move it ahead to see how far the hole goes to a jumpable distance.

Thanks
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 2nd May 2016 19:14 Edited at: 2nd May 2016 19:17
I use something like this:
this method allows you even stair step detection.

[/url]

Login to post a reply

Server time is: 2024-05-08 01:00:46
Your offset time is: 2024-05-08 01:00:46