Gravity
From Mario Fan Games Galaxy Wiki
Revision as of 20:12, 6 December 2007 by Xgoff (talk | contribs) (Gravity Methods moved to Gravity: eh...)
Gravity is a very important element for any platform game, yet is usually one of the hardest features to implement. There are four types that are commonly seen in fangames: Triangular, Trapezoidal, Simple Parabolic, and Modified Parabolic.
| Triangular Method - The least accurate of all methods; there is no acceleration or deceleration during the rise and fall, which makes it easy to implement collision-checking (character only needs to be "pushed out" by a set number of pixels) | |
| Trapezoidal Method - Slightly more accurate than the triangular method as it approximates a parabola more closely; it shares the same lack of acceleration/deceleration as triangular movement, and can therefore use the same collision checking routines. | |
| Simple Parabolic Method - Even closer to actual Mario gravity, though the peak is quite sharp and can make jumping even small pits difficult at low speed. Acceleration and deceleration constantly changes, and the value of each upon impact with an obstacle can vary, requiring a much more involved and complicated collision-checking engine. | |
| Modified Parabolic Method - About as accurate as possible, this method is similar to the simple parabolic method. However, it involves extra code which smoothens and lengthens the parabola at a given speed, making it much easier to jump pits at low speed. It can use the same complex collision-checking routines as the simple parabola. |