Scripting Q!!

Started by Hammerite, Fri 13/06/2008 15:20:03

Previous topic - Next topic

Hammerite

What are some of the mathematical commands actually for?
Like sin, etc. What use do these have for gamemakers?
i used to be indeceisive but now im not so sure!

SSH

Sin and other trigonometry will be used in programs the need to calculate geometry, e.g. 3D objects, etc.
12

GarageGothic

#2
As someone who just scripted a wave effect function using Math.Sin, I can tell you that they're very useful indeed. I think about half the code in my game uses mathematical functions in one way or another. You can easily script a typical adventure game without them, but if you ever want to implement visual effects such as realistic shadows, surface deformation, draw non-standard geometrical shapes (ellipses etc.) or rotate graphics and re-calculate the offset to align them on-screen, it's a must have.

Also, more action-filled games can use Maths functions to calculate physics, for instance I just did a particle system which uses some of the trigonometry functions (not really necessary, but it's fun to integrate cool stuff).

Edit: Something as simple as a scroll or screen fade function can also use sine calculations as an alternative to a linear falloff.

SMF spam blocked by CleanTalk