Slow down over high ground
I have some simple 2D physics for my sprites moving over a flat surface which works adequately. I have now put a variable height landscape and everything seems to work ok except the sprites speed over the surface. Obviously (now that I come to think about it) 2D speeds over a 3D landscape is way too simplistic: the sprites appear to rise over the landscape at mach 1. Is there a simple way to put more realistic behavior without huge effort. (If the gradient is too steep then I guess that direction should be a block going up or a fall going down).
The sprites have x,y coordinates and z which reflects the height for each floor panel...
The sprites have x,y coordinates and z which reflects the height for each floor panel...
I hope I understood your problem correctly.
You could calculate the angle of the slope you're on (with atan(ydiff/xdiff) or similar). You can then multiply your 2d velocities by cos(angle) to get the effective velocities.
You could calculate the angle of the slope you're on (with atan(ydiff/xdiff) or similar). You can then multiply your 2d velocities by cos(angle) to get the effective velocities.
Thanks _ibd_ that would be it. Thanks!

