New account registration is temporarily disabled.

MCBICK'S PROFILE

Search

Filter

Trigonometry script for rpg maker 2003

author=DFalcon
If, say, you want circular motion but your intended number of frames doesn't divide nicely into the given lookup table's, there's an easy approximation trick to get circular motion or construct your own lookup table.Because d/dx(cos x) = -sin x and d/dx(sin x) = cos x, each frame you can basically just have:

y += x/c
x -= y/c

for some constant c not too large relative to the range of x and y; in something like RM2K(3) this might require keeping, say, x*256 and y*256 and using those in the calculation then dividing down.

The above has a period of basically 2*pi*c iterations, though there can be a touch of rounding error.

Ellipses you can do with:
y += x/a
x -= y/b
(this gets you a period of 2*pi*sqrt(a*b) and a y-axis length of (x-axis length)*sqrt(b/a) IIRC.)

Not sure if the lookup table in the article was constructed like this or some other way, I don't have RM2K3 on this computer.

Hmmm, you lost me after that.

This is good I think, least from what I understand. I always had to make my own events for stuff like this, but now I can use this.

Basic Frankenspriting Tutorial

Lol I always did it the hard way by just editing the character then pasting the parts over the main sprite. Nice tutorial, kinda short though.

Roaming, Hero Hunting, Pre-Emptive Strikeable Monsters

Cool, nice tutorial.
Pages: 1