Coding editors is fun!

Editor Progress

So last week I decided to start work on my map editor to get something that fits more with what I want Doc Cosmos 2 maps to be like. And so I spent most of the week playing around with Haxe and HaxeUI and now I have something that definitely is good enough. It's still missing many features but already I've been able to use it to create the basis for World 1:

So far I can create hires and multi color character sets, 4x4 tiles and a large 128x64 map and switch between charsets on the fly to see how both timelines look. The editor also has rudimentary animation allowing me to do simple bit shifts on characters or create sequence animations for more complex stuff. It also has collision mapping tools to allow me to assign any character to be solid, kill player, climbable or active (such as power consoles). I just about managed to get all that done and add the "Export to Game" functionality so I can test stuff in game and create a nice video for this weeks blog :)

I spent a little time playing around with the editor and decided on the theme you can see in the above screenshot for the first world. It's based quite heavily on the original game and reuses a lot of the assets. I did redo the rocks though as I preferred this blue colorful look, and I added vines to give Doc something to climb in the future timeline.

Back to the Game

With the editor now capable of producing useful maps I took a break from coding that and went back to the game to iron out a few wrinkles here. First up was the player snapping glitch.

When the screen was scrolling and you landed on solid ground Doc would jitter up and down as the screen scroll came to a halt. This turned out to be happening due to a bug I introduced when rearranging code for the last iteration of the scroller. When the screen scrolls it offsets all map chars by between 0 and 7 pixels in both the x and y directions. However this offset is NOT applied to sprites (and neither do we want it to as we want the sprites to appear to be moving smoothly through the scene) and so the collision calculations between player and background need to take this scroll offset into account. Previously I had this working and it turned out to be just an order of operation thing, I was performing the snap too late and so it was not being seen in the current frame but the next, causing a horrible jitter.

Finally last night I created the first of what I assume is going to be multiple iterations of a 2x2 HUD font and used that to create a simple HUD replacement that fits the game much better than the previous abomination. I also took the opportunity to add a little flair to the level start sequence, and I must say I quite like the results. I will most likely use this banner effect for text dialogues as it uses a raster split to change to a different VIC bank and charset font, which allows me to keep all 256 chars in the map font for map stuff and not waste space on an alphabet like the original game had to do.

Next Up

Anyway next up this week is starting to arrange all the code in memory properly instead of the current mish mash of locations. I want to get the code running from a cartridge file so I can start linking different game parts together. I also want to look into using bank switching to accelerate the color RAM scrolling, as this might help with NTSC machines. Anyway here's the video of the game so far:


Log in with to leave a comment.

Love the scrolling - huge leap from the already awesome original!