7800 Jr. Pac-man Construction Set Build 4
Ok made some more progress on this project today. First I added some of the basics such as the ability to cut, copy, paste and delete. Build 3 was mainly fixes I found while playing with Build 2.
You can place items on the board by selecting one or more cells and pressing one of the following keys on the keyboard
• SPACE - places a maze part
• D - places a Dot
• E - places and Energy Dot
• Delete - clears a dot
If you hold down the left mouse button while pressing any button it will clear the cell. As I was playing with it I found myself wanting to toggle and this is a quick way to place and replace an item.
When you place a game piece on the maze it will automatically enforce the rules I described in my previous blog entry. This is just one thing that is counter intuitive, but once again it's really a limitation of the level implementation and trying to use a single design surface. The other is copy/paste, but moore on that later.
I also added context menu (right click on maze) with some additional time savers. I figure most people will create the outline of the maze first and then add dots. While there is menu item "Auto-fill dots" it will fill every available empty space. Alternatively you can select a region, right click and add dots to selected. Just as easily you can select a range and clear dots selected. Once I created those two adding/clearing maze selections was just the inverse of the logic.
Copying and Pasting... I've done this with all my other tools so you would think I could just lift the code and work with it. Sure enough all those were just binary on/off. Since a cell in Pac-man can have a piece of the maze, dot, energy dot, or empty I had to create a new copy mechanism. That actually isn't the hard part, it's the paste! Since Jr. Pac-man stores half the maze and just reflects it in the game paste needs to be reflected. So the tough part is if you’re pasting on the right side of the maze in cells greater than 28 and you are pasting you need to think in reverse! As a hint if you copy from the right side it will select the region on the left that is the equivalent. At least this somewhat helps you from pasting a mistake. Even if you do make a mistake there is now Undo!
Undo and Redo is another one of those things that gives me a hard time to implement. Basically I use two queues. In vbB I would have to keep track of all sorts of possible changes, resizing, rotations, colors, as well as pixel placements. With Jr. Pac-man I realized with a fixed 57x31 grid I just need to create snapshots. This is probably a bit of a memory hog, but ram is free nowadays. Anyway it will keep track of the last 100 changes and allow you to undo them. Undoing, just moves it to the redo queue in case you have a change of heart.
Anyway here is the latest screen shot

0 Comments
Recommended Comments
There are no comments to display.