Moving Layer Calculations

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

SuperMario7
Flurry
Flurry
Posts: 367
Joined: Fri Dec 20, 2013 5:49 pm

Moving Layer Calculations

Postby SuperMario7 » Sat May 24, 2014 7:56 pm

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.

Chad
Ripper II
Ripper II
Posts: 330
Joined: Sun Mar 02, 2014 3:22 pm

Re: Moving Layer Calculations

Postby Chad » Sat May 24, 2014 10:19 pm

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.

SuperMario7
Flurry
Flurry
Posts: 367
Joined: Fri Dec 20, 2013 5:49 pm

Re: Moving Layer Calculations

Postby SuperMario7 » Sun May 25, 2014 8:14 am

Thanks Chad! My problem is solved, so you moderators can lock this if you want.

zlaker
Birdo
Birdo
Posts: 2844
Joined: Fri Dec 20, 2013 1:46 pm

Re: Moving Layer Calculations

Postby zlaker » Sun May 25, 2014 8:39 am

I didn't quite understand the calculations. Could you give an example or anything like that?

bossedit8
Banned
Posts: 6838
Joined: Fri Dec 20, 2013 12:35 pm
Contact:

Re: Moving Layer Calculations

Postby bossedit8 » Sun May 25, 2014 9:56 am

Maybe something like this: 32 . x (number of blocks to move) : y (number of seconds to take) : 65

Chad
Ripper II
Ripper II
Posts: 330
Joined: Sun Mar 02, 2014 3:22 pm

Re: Moving Layer Calculations

Postby Chad » Sun May 25, 2014 12:15 pm

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.

zlaker
Birdo
Birdo
Posts: 2844
Joined: Fri Dec 20, 2013 1:46 pm

Re: Moving Layer Calculations

Postby zlaker » Sun May 25, 2014 12:20 pm

Oh oki. Tnx for explaining to me Chad

Fuyu
Boom Boom
Boom Boom
Posts: 3137
Joined: Sat Dec 21, 2013 2:40 pm
Pronouns: He/Him

Re: Moving Layer Calculations

Postby Fuyu » Thu Jun 05, 2014 10:35 am

I think this topic should be stickied, since it could help many people.


Return to “Help and Support”

Who is online

Users browsing this forum: Amazon [Bot] and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari