MetalX Update

The newest update is available here.

I put it up mainly to showcase the new sprites and animations. They’re all created from a single 200×200 spritesheet. The size and animation cell lengths are arbitrary. Each room pulls its own tiles from where it wants. If no tiles are assigned, the room will paint itself in a single color. This is my first built-from-scratch engine animation.tileset

Behind the scenes, I’ve added blueprints. Blueprints are a set of rooms that are independent of a ship and its rooms. It allows the ship to add/remove rooms from itself based on its blueprint (probably a better word for ‘blueprint’ would be ‘schematic’). A blueprint can be given to any number of ships. I’ve also prebuilt blueprints for testing purposes: a smaller ship as seen in 1.1.0.2, and a gigantic ship. These can be swapped by one line of code.

The other major change was redoing the way controls work. Now they’re a lot more robust, with panels, texts, and rotations all built in. The tabbed group on the right is another type of control. Eventually I want most of the commands available via similar sliding controls.

For awhile, there was a way to add additional blueprints and the ability to create ships based off of those blueprints. You could then “launch” those ships (really just shooting a ship out of a hangar room just like a bullet). These weren’t the actual blueprints as explained above, so when I added the real blueprints, this ability got borked. It will be back!

To make future builds easier, I created my first .bat file. It creates a folder onto the desktop, copies the javascript and image files into it, and then merges all the .js files into one. I then create the obfuscated .js file, make a shitty HTML5 page, and upload it all to the site. Still takes long than I’d like, but it’s getting there. I had to hardcode the .js files into the .bat file since I couldn’t parse the HTML file correctly. The file is shown below. Edited for readability.

set today=%date:~10,4%_%date:~7,2%_%date:~4,2%
set now=%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2%
Set targetDir=%userprofile%\Desktop\MetalX_%today%_%now%
Set sourceDir=”%userprofile%\Desktop\My Dropbox\workspace\MetalX”
md %targetDir%
xcopy /s/e %sourceDir%\js %targetDir%
PING -n 5 127.0.0.1>nul
for /d %f in (%targetDir%\*) do copy %f %targetDir%
md %targetDir%\images
copy %sourceDir%\images\ %targetDir%\images\
copy %sourceDir%\metalx.html %targetDir%
cd %targetDir%
copy requestAnimationFrame.js+vector2d.js+…+metalx.js MetalX_1.1.0.2_unobfuscated.js