Friday, 12 December 2014

[Game Maker] Slope Physics Engine UPDATE v1.0.2.3

An update for my physics engine. Might not seem like much of an update, but I fixed some key problems I had, and reconfigured the engine to make it much more manageable (to me, anyway).

FEEL FREE TO CHANGE THE OBJECT PROPERTIES OF OBJ_BLOCK AND OBJ_PLAYER IN CREATION EVENT. If you find any bugs, just leave a comment on this post.

Source code (.gmz):
Physics+engine+1.0.2.3.gmz

Windows (.exe):
Physics-Engine-Default-1.0.2.3.exe


Update log:
New Features:
    - Friction
    - Walking force (instead of constant air-forced walking)
    - View, along with view-shake (screen shakes if you crash hard enough).


Bug Fix: Fixed bad calculation of slope when scr_slopecalculatex or scr_slopecalculatey were about to run into the wall(I made it so if they were about to collide, make the perpendicular dimension(trise or trun) longer, so that the slope takes into account the wall.

Bug Fix: Accelleration and speed now include fractions of pixel-units, instead of just increasing by integers(changed scr_movex and scr_movey so that it added on the fraction of the pixel not normally added (since it only added to the distance traveled if there was at least 1 whole pixel length (distx*stepxleft or disty*stepyleft) left).



Note: The hardest part about this update was the bad slope calculation, as I couldn't find out what was causing the error for the longest time, and it really frustrated me.

No comments:

Post a Comment