Page 1 of 1
Moving Layer Calculations
Posted: Sat May 24, 2014 7:56 pm
by SuperMario7
I remember Chad's tutorial on how to calculate how to make blocks move a certain amount of spaces in a certain amount of time. Does anyone remember this, or is there another topic for it? Thanks.
Re: Moving Layer Calculations
Posted: Sat May 24, 2014 10:19 pm
by Chad
It wasn't my tutorial. DarkMatt originally posted it a long time ago on Knux's forums.
Basically it's 32 * x / y / 65.
32 is the width/height of a single block, x is the number of tile spaces you want it to move, y is the number of seconds you want it to take, and 65 is SMBX's max framespeed. The result will usually be a number with a huge decimal, and you should use a few of the digits past the point.
Re: Moving Layer Calculations
Posted: Sun May 25, 2014 8:14 am
by SuperMario7
Thanks Chad! My problem is solved, so you moderators can lock this if you want.
Re: Moving Layer Calculations
Posted: Sun May 25, 2014 8:39 am
by zlaker
I didn't quite understand the calculations. Could you give an example or anything like that?
Re: Moving Layer Calculations
Posted: Sun May 25, 2014 9:56 am
by bossedit8
Maybe something like this: 32 . x (number of blocks to move) : y (number of seconds to take) : 65
Re: Moving Layer Calculations
Posted: Sun May 25, 2014 12:15 pm
by Chad
Ice wrote:Could you give an example or anything like that?
Let's say you want to have a layer move 7 spaces in 4 seconds. Multiply 32 by 7, divide that by 4, and then divide that by 65 and you'll get your desired speed.
However, it's worth noting that with higher speeds, you may still need to play around with the resulting number a bit.
Re: Moving Layer Calculations
Posted: Sun May 25, 2014 12:20 pm
by zlaker
Oh oki. Tnx for explaining to me Chad
Re: Moving Layer Calculations
Posted: Thu Jun 05, 2014 10:35 am
by Fuyu
I think this topic should be stickied, since it could help many people.