HELP! Character Glitches through blocks!

Non-platform specific questions.

HELP! Character Glitches through blocks!

Postby JamesTheHedgehog » Wed Jun 18, 2008 6:35 pm

How come every time i move my character he glitches through a block?
Ive wanted to fix this, but i never can! Please help!
User avatar
JamesTheHedgehog
 
Posts: 3
Joined: Wed Jun 18, 2008 4:50 pm
Score: 0 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby DST » Wed Jun 18, 2008 6:57 pm

This is the oldest and most repeated question on the forums. Try a search for 'collision' in the main search box.

Physical response is ur problem.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby xr2alex99 » Wed Jun 18, 2008 7:48 pm

buddy
go to collision. then choose your colliding actor.
choose to repeat this event while colliding /the yes no question/
then instead of calculator go to specify. your codes are 1/1/0/1 ok. it works.
(\___/) My bunny :twisted:
(=' . '=) is a king of :twisted:
(")___(") awesome :twisted:
User avatar
xr2alex99
 
Posts: 22
Joined: Sat Sep 01, 2007 7:48 am
Score: 0 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby DST » Wed Jun 18, 2008 7:55 pm

Lol it works for crap. Making good collisions is a lot more than setting a physical response.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby JamesTheHedgehog » Wed Jun 18, 2008 11:07 pm

im still stuck, can you tell it to me in an easier way?
User avatar
JamesTheHedgehog
 
Posts: 3
Joined: Wed Jun 18, 2008 4:50 pm
Score: 0 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby DST » Wed Jun 18, 2008 11:22 pm

there are two ways to do collisions: Physical Response and Collision Free. Both have their advantages.

Physical response waits for a collision between two objects, then moves them outside of each other, while collision free is used to prevent collisions from ever happening.

an example for collision free is

if (CollisionFree("Event Actor", x, y+5))==0{y+=5};

This will cause a player to move down at a speed of five until something is in its way. This method takes some getting used to, but provides much more solid results than physical response.

The best way is a combination of the two. Since gravity must increase as a player falls, the landing spot can be unpredictable. If a player ends up 3 pixels above the platform, the collision free no longer equals zero and the player stops.

So what i do is use collision free for left to right movement, and physical response for up and down movement.

However, the shape of your actor is also a factor. Hey that rhymes.

If your actor's feet move all over the place, its hard to make good collisions. Remember how Mario was always a solid block, in a way? his feet were flat. that's very important. I am going to release a demo later today showing a good collision method.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby JamesTheHedgehog » Wed Jun 18, 2008 11:35 pm

sorry if im getting annoying, Can you tell me EXACTLY what i do?
Like what i should put down for text, Im kinda new, and im clueless...
User avatar
JamesTheHedgehog
 
Posts: 3
Joined: Wed Jun 18, 2008 4:50 pm
Score: 0 Give a positive score

Re: HELP! Character Glitches through blocks!

Postby feral » Thu Jun 19, 2008 1:34 am

JamesTheHedgehog wrote:sorry if im getting annoying, Can you tell me EXACTLY what i do?
Like what i should put down for text, Im kinda new, and im clueless...


try this demo it is very basic and only has what you need so should be easy to follow

viewtopic.php?f=6&t=5768

feral
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron