Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hammerite on Fri 13/06/2008 15:20:03

Title: Scripting Q!!
Post by: Hammerite on Fri 13/06/2008 15:20:03
What are some of the mathematical commands actually for?
Like sin, etc. What use do these have for gamemakers?
Title: Re: Scripting Q!!
Post by: SSH on Fri 13/06/2008 15:46:03
Sin and other trigonometry will be used in programs the need to calculate geometry, e.g. 3D objects, etc.
Title: Re: Scripting Q!!
Post by: GarageGothic on Fri 13/06/2008 15:58:33
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.