Fourinone's Block Tutorial for Cool PeopleHey, everyone. I thought perhaps I'd share my block expertise with everyone here. Now, of all items in the Level Designer, the rotating and moving block is the most versatile, allowing you to make many different things with them. You've probably used these before, but do you understand how it all works? Well, this is what this tutorial here is for. Yay?
Note: Most of this stuff works for green platforms, as well. They just...aren't as cool, hehe.
First, some terminology: The game is made up of
pixels. One grid/tile on the level designer is 32 pixels x 32 pixels. Also, since I need a unit of time, I've made an arbitrary unit called a
frame. I doubt this is the same as the actual frames in the game, but for the sake of convenience, let's just pretend it is... <_<
Speed: This is the number of pixels which the block moves in one frame. So, a block with speed 2 is twice as fast as a block with speed 1.
Length: This is the number of frames which the block moves in the specified direction. After moving the number of frames in that direction, it will move the same number of frames in the opposite direction.
-> The total number of pixels a block moves is its speed multiplied by its length. Remember that one tile is 32 pixels. Use this to calculate exactly what length you should enter into your block to fit your level just right!
Offset: Now, offset is an interesting thing. It is the number of frames which the block has already moved in it's path, pretty much, how "in sync" it is. Confused? Basically, for a block with 64 length to the right and 32 offset, the block starts with 32 of those 64 frames having already occurred, so it would move 32 frames to the right, then 64 to the left, then 64 to the right, and so on. The maximum offset you can have is equal to the value you put for length; any value higher than this will be equal to this maximum. Essentially, a block with 64 length to the right and 64 offset should be the same as a block with 64 length to the left and no offset.
-> Why should you use offset? Well, you won't be using it much, but say you want to make a "wavy" floor, where it undulates in a smooth, wave-like pattern. Offset is your friend here!
Negative Offset: Wait, what now? A negative offset value does something
different? Gasp! When a block has negative offset, it moves that many frames extra at its given speed before going to its regular behavior. Say, if a block has 3 speed, 64 length to the right, and -32 offset, it will first move 32 frames to the right at speed 3, then it will go right 64 frames, then left 64, and so on. Think of it this way: whereas positive offset is how many frames the block has already travelled, negative offset is how many frames the block still needs to travel before moving normally.
-> Ever wanted a block to travel out far somewhere, and then stay in that general place? Negative offset is for you! This is great for elevators and such.
-> Since the offset space allows only 3 characters, you'll need to manually edit the code yourself to enter values lower than -99. Read Superyoshi's tutorial above if you don't know how.
Acceleration: If you've fooled around with the stuff mentioned above already, you may have noticed that the block doesn't exactly move the same number of pixels as I claimed it would, hehe... This is because of this annoying thing called acceleration. Acceleration affects the behavior of the block as it approaches the end of its path, controlling how much it slows down and speeds up as it switches to moving in the opposite direction. A low acceleration value means a slow, smooth switch, and a high value means it will abruptly switch directions with little slowdown.
So, why is it so annoying, then? That's because it completely screws with the speed, messing up the number of pixels it SHOULD have travelled. (I'm not sure where this acceleration coefficient goes in the calculation, but an acceleration value of 1 messes the path up the least.) Note that a block with an acceleration less than 1 will stop short of its starting point when it turns around, and a block with a value greater than 1 will go slightly past its starting point. Keep this in mind when placing your block, and watch the shadow to see if it's going where you want it to go. (Or, just use 1 acceleration to keep it simple.)
...or use this nifty formula, courtesy of level4:
level4 wrote:Finding the actual length of a moving block:
For moving blocks with an acceleration of 1 or greater, the distance traveled by the block is equal to speed * length – speed^2. For example, a block with a speed of 4 and a length of 60 will travel 224 pixels from its starting position, or 7 spaces (one space is 32 pixels).
To get a block with a certain speed to move a certain distance, the length entered would be (wanted distance)/speed + speed.
To get a block with a certain length to move a certain distance, the speed entered is
length - √(length^2 – 4*(wanted distance) )
2
(does not work for blocks with very high speed and short length).
It is usually easier just to guess, but this might be useful for some stuff.
-> Adjust this value depending on how you want your block to act. If you want stiff and quick, use 999. If you want it to slow down a lot, use 0.1 or something like that.
-> So, you want the block to move, and then stay perfectly still? Well, you can't do that. : ( But you can get close. Set length to 0, acceleration to 999, and change speed and offset as needed. The block will vibrate in place, but that's the closest you can get. Even better for elevators, huh?
Rotation Speed: Just like what it sounds like, this is how quickly it rotates. Like linear speed, a block with rotation speed 2 is twice as fast as one with rotation speed 1. A rotation speed of 0 makes the block not rotate at all.
-> Rotation speed and linear speed are approximately equal, so set them to the same value to make a block look like it's rolling along the ground!
-> You can also code edit a large number into it for some crazy fast spinning blocks. Yay!
-> Inserting a negative value into rotation speed is the same as clicking the left/right button.
Wait Time: How much time it waits before rotating again. A block rotates 90 degrees every time. A wait time of 0 causes the block to rotate continuously. This also controls the amount of "wobble" the block has before rotating. The lower the wait time, the less wobble.
-> When rotation speed is 0, the block still wobbles, depending on the wait time. Want a block to stay perfectly still? Set both rotation speed and wait time to 0.
Size: This is the length and width of the block, in pixels. A block with size 32 is the same size as a tile.
Well, that's mostly all you need to know about blocks. I hope you learned a few things. Now go out there and wield those blocks like a BLOCK MASTER!