Physics Issues

Non-platform specific questions.

Physics Issues

Postby Hedfone » Sun Mar 22, 2009 9:36 pm

I'm making a platformer and before i get too involved with it i wanted to clear up a couple basic problems i've been having with the physics.

The first one is that if if my character jumps and hits a wall, he just sticks there as long as the arrow key is held down.
The second problem is that sometimes while stationary, if the player is too close to the edge of the platfom (even though it's completely horizontal) He'll just start to slide off of it, one pixel at a time.

Does anyone know how to fix this? Seriously annoying...
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Re: Physics Issues

Postby jimmynewguy » Sun Mar 22, 2009 11:51 pm

for the wall sticking just have collision on left or right side of wall ~~ yvelocity += 1;
or what ever you use for gravity, and for the sliding thing you can make a actor called "player real" thats a box to make collisions smooth then just have the player with all the images follow him, if you don't get it i think there is a demo for collisions......http://game-editor.com/forum/viewtopic.php?f=5&t=5826 found it (DST thanx) :lol:
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Physics Issues

Postby BlarghNRawr » Sun Mar 22, 2009 11:53 pm

the wall sticking is fixed by putting in your gravity code (probably yvelocity=yvelocity+5) in for the collision on left or right side of wall

and the other problem i fix by putting the VERY side of platforms 1 pxl higher :)
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Physics Issues

Postby DST » Mon Mar 23, 2009 2:00 am

Use pyro's wallside fix for best collisions. Disregard the perfect collision demo. Its too much work.

Collision>left or right side of wall>

Code: Select all
int j=yvelocity;
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1, 1, 0, 1);
yvelocity=j;



this works better than anything else so far.
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: Physics Issues

Postby pyrometal » Mon Mar 23, 2009 3:32 am

DST wrote:Use pyro's wallside fix for best collisions.


lol, I've become popular! Since the PhysicalResponse() function is uncustomizable, you sometimes have to work around it slightly... I wish this was not the case but these work arounds are a lot less work than creating your own collision script (which I've done before at the cost of several headaches and days of work...)
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Physics Issues

Postby Hedfone » Tue Mar 24, 2009 10:17 pm

BlarghNRawr wrote:
and the other problem i fix by putting the VERY side of platforms 1 pxl higher :)


Sorry, what do you mean?


ps: thanks to everyone! I really appreciate your help :)
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Re: Physics Issues

Postby BlarghNRawr » Wed Mar 25, 2009 8:54 pm

picture shows how...
example.PNG
look closely


if you dont want to see the extra pxl, make it a different actor with the same properties, and change its visibility state to "dont draw but allow events" tis wont work if you have a flat char standing right ontop of the pixel, but its the closest ive gotten to fixing the problem... :)
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron