STRETCHY SHRINKY FLIPPY BLOCKS

A how-to for making flip block platforms.

Some stages in Super Mario World feature yellow platforms that stretch and shrink, as seen in this picture here:



Through careful use of layer movement, recreating these structures is possible in SMBX. It requires many layers and events, though, so pay close attention!

First, you need four new layers; one for each block. The middle block doesn't move, so it can stay on the default layer.



Name them carefully so you don't get confused!

The outer blocks will be moving across two tiles while the inner blocks only move one. To make the platform expand and contract horizontally, you need 16 events; four for each block. The basic setup is the same for all four.

1. Shrink
2. Pause
3. Stretch
4. Pause

These events need to be set to trigger each other, and each block needs its own separate set of events to work. So, for Inner1 to contract and expand, you'd use the following:



Moving at a speed of .97 for .5 seconds, Inner1 will move exactly one tile to the right. Making another event wherein it moves -.97 for .5 seconds will put it back where it started. However, the Outer1 block has to go twice as far. Doubling its move speed to 1.94 lets it cross the two tile distance in the same time frame. Moving Inner2 and Outer2 works the exact same way, but with the negative speed first. This lets the platform look like one complete object instead of four separate ones.

Don't forget to set the initial events to auto-start!

Making the blocks expand up and down is just as easy! All you have to do is use the same speeds for vertical movement instead of horizontal. If you wanted, you could chain the horizontal and vertical events so the platform can expand alternately in both directions!

Before you use these blocks, it's important to note a few problems with them:

1. Even with just one direction of expansion, you have 16 events running constantly. This can cause a lot of lag in SMBX. If you're using these blocks, it's advisable not to have any other moving layers in the same level.

2. Due to the way SMBX handles Mario's momentum on a moving solid, these blocks can screw with his physics a bit. When moving horizontally, the blocks can propel Mario more rapidly than they ought to, which can make falling off very easy. Not a good thing if the platform's over a pit!

Vertical movement is perfectly safe, though. Also, if you cut the move speed in half (.485) and double the time (1 second), it won't throw Mario around as much, but the platform will look slow.

3. Since these are flip blocks, they can still be broken with spin jumps or knocked from below. Putting coins in them will prevent them from breaking. Even better would be to resprite an indestructible block as a flip block so you can maintain the illusion without incident.

------

And that's all you need to know about stretching and shrinking flip block platforms. Spice up your SMW throwback stages! User discretion is advised!

Posts

Pages: 1
I've done these before, but instead of "screw with physics a bit" it would LAUNCH Mario around like a slingshot! I also remember it completely bollocksing up Mario's regular walking around speed. I abandoned the effort completely because it made the level unplayable.
halibabica
RMN's Official Reviewmonger
16903
How long ago was that? The effect wasn't so dramatic when I tried it. And like I said, slower speeds for the blocks are safer.
author=halibabica
How long ago was that? The effect wasn't so dramatic when I tried it. And like I said, slower speeds for the blocks are safer.
During the development of my Castle Crushers level for SRW. (this is how it ended up having those "reappearing" snake-blocks instead covering the chasms; I originally intended to use stretchy-shrinky blocks).

I was using whole numbers or simple fractions, though, like 0.5 and 1, and not 0.97

I would have to recreate it again in SMBX because I lost my "trying things out" level file. But I vaguely recall it permanently messing with Mario's walking speed if I jumped off the blocks while it was moving.
halibabica
RMN's Official Reviewmonger
16903
Weird. I might have to experiment with that at some point. I got these numbers because I was trying to make SMBX move the block exactly one tile (which it did). Even if flippy blocks are too buggy for practical use, the numbers could have other applications.
Yeah, moving layers can cause some weird problems. Especially with NPC's. Throw a turtle shell onto a moving layer and watch it fly.
halibabica
RMN's Official Reviewmonger
16903
We do love our goofy little program.
Pages: 1