Newbie Asks: How do you do collision detection. ?

Non-platform specific questions.

Newbie Asks: How do you do collision detection. ?

Postby ggesterGamePro99 » Wed Apr 18, 2012 8:45 pm

I saw some Game-editor video but i'm not quite sure.

There's a colider object that you add right?

So, tell me if this is right? I make a character, i make a collider.. Then i parent the collider to the character( Somehow, i don't even know how).. and then that's it?
And i would do the same for all level elements like walls, etc?

And so basically:
1How would you tell the actor to not be unable to move, if he comes up to a wall.
2 and also how would you tell a player to get pushed back if he collides with an enemy OR how to change the character animation to GETHITanimation, if he collides with the enemy and the enemy animations are PUCHanimation.?
ggesterGamePro99
 
Posts: 44
Joined: Mon Apr 16, 2012 1:53 am
Score: 0 Give a positive score

Re: Newbie Asks: How do you do collision detection. ?

Postby skydereign » Wed Apr 18, 2012 9:14 pm

Any normal actor can collide. You don't need to create separate actors to handle collisions. But, if you don't actually want the animation to be the collision region (for instance the player) then you would need to create an actor to act as the player's collision region. To do this create either a filled region, or just a normal actor with a bounding box animation (can just be a solid rectangle). Then parent the player to it (not the colliding actor to the player). This will make the player follow the bounding box. This also means that you must instead of moving the player around, move the bounding box around.

Do you know about collision events and PhysicalResponse? It is covered in the gedt's that come with gE, as well as being present in pretty much any basic platformer game you might download here. Anyway, you add a collision event, and use PhysicalResponse to prevent the actors from moving through each other.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron