Thursday, November 6, 2014

Work Completed

Success. Switch Tile Client Editor is working and seemingly has no issues. The two bugs were both fixed by changing just one line of code each.


The first bug occurred in the sub menu with a client group selected. When clicking on a tile type button in the 'Choose the inactive tile type' panel, only one client was being changed.

The problem was in a for loop iterating through the array of the clients being modified. I was using the wrong iterator variable to choose the index of the array. I believe copy pasta is to blame here.

this line:
sc = clients[j];

should've been:
sc = clients[m];


The second bug occurred when there were multiple client groups. Trying to select a client group would either highlight only one client or highlight the whole group plus others that did not belong in the group. Then after clicking to selected a client group, none were shown selected in the sub menu.

The problem was a line of code in the function that builds the group array. When a new group is started, the function first looks for new "control client" to compare with others. Before looking for one, a fresh array called 'assigned' is created and every client that has already been assigned to a group is pushed into it. Since the group array is multidimensional and I don't want 'assigned' to be multidimensional, I use the concat() Array function to populate 'assigned'.

this line:
for each (var group:Array in clientGroups) assigned.concat(group);

should've been:
for each (var group:Array in clientGroups) assigned = assigned.concat(group);

Daily Goal

Same as the last two: Complete the Switch Tile Client Editor

I think I'm satisfied enough with the look an functionality of the editor's GUI to move on to core functionality which would be a working editor...

Pretty much everything is setup and written but there are bugs preventing it from working properly for the most part.

Work Completed - 11/05/14

Blogger had some issues last night so this is 11/05's Work Completed.

The goal was to complete the Switch Tile Client Editor. Although I put in a full day's work, I didn't get around to working towards the goal. Instead, all my time went toward fixing the GUI issues that I had talked about.

I think what I ended up doing works pretty well. I had said that I'd develop a system where GUI sections or panels would fade as the mouse pointer got closer to it. I wrote a new class or two and was able to make this work but later realized that some GUI panels have buttons which of course need the mouse pointer to interact with.

So I developed a 'hide/show info' option. The user can simply toggle the visibility of anything in the way of the puzzle elements by pressing 'H' on the keyboard. I also added a class that takes the dimensions of a rectangle and adds a black panel object behind a group of GUI objects.




With FlashPunk, you can simply change an Entity's Boolean 'visible' property to false so achieving this toggle feature seemed simple enough. However, several of these panels are made up of several Entity objects and then several of those may be made up of several entities. That meant keeping track of a lot of entities which can get quite confusing.

Since most objects are based off of FlashPunk's Entity class, I base all my Entity objects off of a class I wrote called EnityPlus. This simply extends Entity and adds a few things I find helpful.

One big thing I added is a group of functions and an array which are related to adding and removing entities from the world. The array is called 'allWorldObjectsInThis' and a few of the functions are; epAdd(), epRemove(), epAddList()... and so on. The functions simply add and remove entities to and from the world like you normally would ( world.add(e) ), except they also add and remove entities from the 'allWorldObjectsInThis' array.

This allows versatility and automation. For example; FlashPunk calls a removed() function in any Entity when it's removed from the world. In EntityPlus, I over-rid this function and added a loop to remove everything in my 'allWorldObjectsInThis' array from the world. So anytime I remove an entity from the world, any entities that entity has added to the world with epAdd or epAddList get automatically removed from the world.

Now, for turning off the visibility for a group of objects. In EntityPlus I wrote a function called visibility(_visible:Boolean) which sets that entity's visible property to the value passed and then calls the same function for each EntityPlus in the 'allWorldObjectsInThis' array. So if I have an EntityPlus class 'SwitchTileEditor_SubMenu' that has added to the world everything that makes up the GUI panels, I can simply call it's visibility() function when the user presses 'H'.

if (Input.pressed(Key.H))
{

if (visible) visibility(false);
else visibility(true);

}



Wednesday, November 5, 2014

Daily Goal

Complete Switch Tile Client Editor

Same as yesterday.

All of the interface objects are in place. Just need to work out a few bugs.

The look of the interface has been bothering me. The text blends too much with anything bright behind it and there isn't much room for it outside of the main grid.


Text blending with bright background.


I had created a Class 'TextPlus' which extends the FlashPunk Class 'Text' and added an optional boolean in the constructor (_addAntiBlend:Boolean = false). When set true, TextPlus will automatically create another Text object that mimics its parent. That Text object is black and sits 2 pixels down and to the right of it's parent. This helps stop the white text from mixing too much with something bright behind it.

Although this has helped, it still doesn't seem to be enough. Therefor, I was thinking of creating a new 'GUI_Text' class. I want this to add mostly opaque black rectangle background behind the text. Then, so that the user can see what's behind it, I will use an algorithm that reduces the alpha the closer the mouse pointer gets to it. I've actually already used this algorithm with a set of text in the Switch Tile Client Editor:


 Mouse pointer far from text.


 Mouse pointer close to text.

Tuesday, November 4, 2014

Work completed

Limited success. I was able to change the tile types without any issues on one try. Two different bugs occurred on other tries however.

1. When clicking the inactive tile type, only one client of it's group changed (at least visually that is) and when clicking the DONE button, the game crashed

2. When trying to select a group of clients to change, hovering over a client that belonged to a group of several clients only highlighted the one client under the mouse pointer and hovering over others highlighted several that should not have belonged to it's group. Then none showed in the submenu once clicked.



Daily Goals and Work Completed

I was thinking that, for each day I put work into a game, I post a goal. Then at the end of the day a post to say what got done towards that goal.

So with that, today's goal is to complete the Switch Tile Client Editor in Block Pusher.

A Switch Tile is light greenish tile with an 'S' on it. When it is touched by a movable block, certain tiles will change into different tiles for a certain number of moves. Those tiles that change are the clients of the Switch Tile.

The Switch Tile Client Editor is an interface that let's the user change the attributes of the clients of a particular Switch Tile. In Room Editor, when the user places a Switch Tile, he/she is prompted to choose what type of tile it's clients will turn into and how many moves they will stay active. The Switch Tile Client Editor allows the user to modify those attributes at any point in the room editing process.





In production

Block Pusher

Block Pusher is a top down block moving puzzle game. It was actually inspired from the ice cave block pushing puzzle in The Legend of Zelda: Twilight Princess. It looks like a grid of different colored squares. Each color represents a different functionality. Solid light beige is a floor tile. Dark grey is a wall tile. One that is the color of the background but has a thin black outline is a hole tile. There's a light beige one with a black outline and a black dot in the center. That is a goal tile. The blue and red are movable blocks. The goal is to get the movable blocks sitting on all of the goal tiles.



This is my most ambitious project yet. I actually had a working game in about two weeks but was not satisfied with the process of creating a new puzzle. At that point, to create a new puzzle, I would have to enter numbers into a large multidimensional array. So I decided to create a room editor which would allow me to simply place tiles with click and drag. It would also need to be able to test the room and save it to a room playlist if satisfied with the creation.




Taunt

Taunt is a board game I developed in a Media Communications class then later decided to program it. The idea for Taunt came from Chess and an ancient Egyptian game Senet. It has two players with a goal to take all of their opponent's pieces. There isn't much room on the board and early on in the game most move possibilities will result in the loss of a game piece. So a player will often find themselves thinking many moves ahead trying to figure out what move will be the most beneficial sacrifice or which move will taunt their opponent into making the wrong move.






CrossFlip

CrossFlip is a 5 x 5 grid of red and green squares where the goal is to get every square either green or red. Clicking on any square will flip both it and a certain number of squares in its row and column to their opposite color.

There are three difficulties; Easy, Medium, and Hard. Each one flipping a different amount of squares on a move. CrossFlip is a simple idea, yet I have found it extremely difficult to win.