2DRemix Devblog 3: Prefabs, script parameters, and fixed pushing

1. Prefabs

2DRemix has always had a panel containing a “palette” of all the tile images you’ve used in your area, so you can select them and reuse them as needed. With this update, I’ve expanded the items in this palette from being merely images, to also embodying a default color, layer, script, and script parameters, which are all selected when that tile in the palette is selected.

This means there can be a bunch of default objects, such as “grass”, “wall”, “crate”, “pusher” that are all ready to go, and can be dropped straight onto the map with a few clicks.

2. Script parameters

Script parameters are the other new feature I added, which allow the script assigned to a tile to have configurable options - for example the “pusher” script can be configured to push in one of four directions: Up, Down, Left, and Right.

My plan for the future is to have many more scripts that can be configured with many different kinds of options, and once the visual scripting feature is added, to allow simple expressions to be assigned as a parameter, for example a pusher’s direction could be set to “the relative direction of the closest player”, or “random, with a 75% chance of up, and a 25% chance of left”.

3. Fixed pushing

Finally, I altered the behavior around one object pushing another to deal with some edge cases. The player’s movement is now processed first before any other object’s script, and when an object such as the player is pushed immediately after moving (such as when you move sideways while being pushed by a row of pushers), the animation is handled correctly to show the actual trajectory of the object.

Bonus: Livecoding stream

Both script parameters and fixed pushing were implemented in front of an live (online) audience, in my first ever Twitch livecoding stream. I plan to make this a regular activity every Tuesday, so please follow me on Twitch and/or Twitter if you’d like to be notified when I go live.

Demo Video

Tobias Cohen

Read more posts by this author.

Melbourne, Australia