Sunday, November 30, 2014

Work Completed

The goal was:
Create Rooms

I spent all day reworking the look and function of the Switch Tile Editor sub-menu because I didn't like that it had things in the way of the grid. The new look and function is very similar to the Switch Client Creator which has its active type and inactive type selectors at the bottom.


Old look
New look
Switch Client Creator look

Daily Goal

Create Rooms

It's time to put the creative hat on... although I'm not quite sure where I put it. I think once I start working it'll turn up. I came up with a couple ideas yesterday while working on bugs. The first idea revealed an unexpected bug. It's possible to lay a switch tile without adding any clients but I didn't code the save/load class to handle that situation. So I'll have to add something to record the outline colors.




Saturday, November 29, 2014

Work Completed

The goal was:
Testing and Whatever

I've been using RoomSelect a lot while testing and scrolling through numerous rooms to get to the one I want has become annoying. So I decided to add x10 arrows to RoomSelect that allows the user to scroll through rooms ten at a time.





I had a really tough time today with the SAVE CHANGES button in RoomDesigner. When clicking it to save any changes, its alpha should change and stay at 30% but kept changing to 100% no matter what I did. After a lot of testing, I figured out it was due to the changeState() function being called in the Button class's update(). Because the mouse pointer is over the button, the button's alpha property gets set to the hoverAlpha value which is 1 (100%). Still, nothing I did would prevent that so I ended up changing the hoverAlpha value to .3 when the save button's deactivate() is called and then to 1 when its activate() is called.


SAVE CHANGES at 100% alpha after saving



I was thinking today that I'd build an in game menu, accessed by pressing ESCAPE. This would be where all the navigation buttons and options go instead of how I have them in the corners right now. I guess the need for something like that can depend on the number of those GUI elements.

Daily Goal

Testing and Whatever

Gotta find more bugs and work them out. I know there are a few issues with the AddRoomToPlaylist class and the SaveChanges button so I think I'll start there.

Work Completed (11/28/2014)

The goal was:
Work on Bugs and Create Rooms

I didn't spend much time working on BlockPusher but I was able to squash a tricky bug. The game was crashing after completing certain rooms and I was very confused as to why. I used trace() on several things and eventually saw that some indices of my allWorldObjInThis array were blank due to some rooms having blank spaces. So when the game went to change to a new room, it first removes from the world everything that makes up the completed room. EntityPlus tried to remove all indices of allWorldObjInThis in its removed() function, and some were null.

I could just skip pushing the blank spaces into allWorldObjInThis but instead decided to make the blank spaces Hole tiles and then change their visible property to false. This should actually prevent a future problem which would happen when the user moves a block to a blank space. The move calculation will look at the blank space as a Hole tile and give the desired reaction of a blank space.



Friday, November 28, 2014

Daily Goal

Work on Bugs and Create Rooms

Nothing much to talk about. I remember some time back wanting switch tile clients to have goal tiles as one of their tile types so I could make a room with hidden goals. I believe I tried it and it worked with no issues but wasn't ready to implement it yet. So I may look into that if I have time.

I sound a little lost on what to do next but I actually have a list of things to do when I complete a goal, I just don't feel like looking at it right now.

Thursday, November 27, 2014

Work Completed

The goal was:
Add Ability to Delete Switch Tiles From RoomDesigner

Result is success. I have also started creating rooms for story mode. I ran into several bugs along the way and fixed most of them. I think tomorrow I'll work on those bugs and possibly restructure some GUI elements that have proved tricky.

Daily Goal

Add Ability to Delete Switch Tiles From RoomDesigner

I was overwriting the current saved rooms with new ones and found out I can't delete switch tiles. So that's the next thing I need to get out of the way. I also found a few interactivity conflicts and took care of those.



Wednesday, November 26, 2014

Work Completed

The goal was:
Create Puzzles

I didn't come close. After loading Room 1, I went to erase the whole thing and ran into some bugs. I ended up adjusting several things and playing clean up. It's the end of the day and I've just now fixed that bug. It does feel nice however to have some of the code cleaned up and some extra non-needed stuff thrown out.

I've decided that I need to avoid using extra non-local (dunno the correct term) variables as much as possible. They're typically created sort of as a crutch or helper to make something work properly but ends up getting in the way later because it's more stuff to manage. So tomorrow, if I have the time (Thanksgiving), I'll do some more clean up.

Daily Goal

Create Puzzles

It's finally time to start creating the puzzles for the game. I had about 20 already made but I deleted the file they were in while in a rage over a bunch of clutter. I'll also work on any bugs I come across of course.

While trying to fall asleep last night, I had the idea that in Room Designer, the user should be able to move the created room around the grid in case one side runs out space. I started coding it right away and it seemed pretty simple. Maybe I could write a function in the GridSpace class to copy the values of a neighbor GridSpace? Then I began thinking about SwitchTiles and SwitchTileClients and thought this could be a mess so went back to bed. But again, while trying to fall asleep, maybe I just need to move everything 38 pixels in the desired direction and tween the out of place spaces to the other side of the grid. Then use a function that's already in place to update all the gridIndex and roomIndex values. Yes. Maybe that could work.

Tuesday, November 25, 2014

Work Completed

The goal was:
Navigation and Testing

Things seem to be in order. I can navigate the game freely without any issues. In the process, I ended up moving a lot of GUI buttons around and creating a GUI_Constants class so there are some global constant reference coordinates for buttons.

A few nights ago while falling asleep I was deep in thought about physics and Entity's update(). I thought back to creating animations in Adobe Flash Professional and the coordinates of an object in the first frame of an animation. I realized the section for calculating speed in update() should go after the section that updates the position. I may be wrong here but I believe the frame an entity is added to the world also runs update(). If so, that means an entity calculating speed first will not start at the coordinates you specify it to start at. It will start at your specified starting coordinates plus the value of gravity.

Daily Goal

Navigation and Testing

Okay, Block Pusher hasn't been so magnetic to my interests lately but I'm going to push through that today and get some work done. The only navigation missing, that I can think of right now, is a link to the title screen in RoomSelector. So I'm going to get that out of the way and look for bugs along the way by testing.

For the times I couldn't pull myself to work on Block Pusher, I used some of that time to work on artwork for a different project I have on the back burner. Everything is made of 8x8 black outlined squares and I've been converting that to something more of a cell-shaded look.





Wednesday, November 19, 2014

Work Completed

Ugh

I spent the whole day improving the new title screen falling blocks background because I wanted the direction they fall to be randomized to up, right, down, or left when the user enters the title screen. Unfortunately I ran into several bugs along the way.

Since the FallingBlock class had to be dynamic with the axis and direction for calculating the movement, I started using Point variables. Now for whatever reason, even though I set a FallingBlock's targetCoord:Point to the proper target coordinates each time it was added, if it was a recycled entity, its targetCoord would reset to the values assigned when first created. I eventually just instantiated targetCoord each time FallingBlock was added to the world.

Another tricky bug caused the addBlock() function to be called when it wasn't supposed to causing everything to be off balance. That one took too much time and effort to figure out.

But at least it's working now.



Daily Goal

More Navigation and Testing

It seems like there isn't a whole lot to do right now so I'll stick with more testing. I do have a list of things to do, most of which have been done. A few important things would be; User save files for tracking progress and scores, A room-complete splash screen after completing a room, A way for the user to delete a room they created.

Since I had so much fun with the falling blocks title screen background, I wanted to write more about it. BlockPusher game play uses a tween to move a block you push to its destination but for the falling blocks I used physics.

When I first wrote the physics in the update of the FallingBlock class, I used several booleans like willFall and atLimit to stop update from moving the block or increasing speed. I had also made a Number variable called nextY which was part of a calculation to check what would be the next y coordinate of the frame making sure the block wouldn't pass its target coordinate. I realized later that I actually didn't need the booleans or the extra nextY variable and was over complicating the process. The only variables I needed were speed, gravity, terminalVelocity, and targetCoordinate. With those:

override public function update():void
{
    if (speed < terminalVelocity)
    {
        speed += gravity;
        if (speed > terminalVelocity) speed = terminalVelocity;
    }

    if (y < targetCoordinate)
    {
        if (y + speed >= targetCoordinate)
        {
            y = targetCoordinate;
            
            // for the green flash:
            if (FP.rand(10) < 2) addFlash();
        }
    }
}

Tuesday, November 18, 2014

Work Completed

The goal was:
Navigation and Testing

I got some navigation done and worked out a few bugs. Nothing very exciting. I did add a few new functions to EntityPlus. One is centerOnTarget(_e:Entity) which will center an EntityPlus on the Entity you pass.

public function centerOnTarget(_e:Entity):void
{
        var thisImg:Image = graphic as Image;
        var targetImg:Image = _e.graphic as Image;

x = (_e.x + (targetImg.width * .5)) - (thisImg.width * .5);
y = (_e.y + (targetImg.height * .5)) - (thisImg.height * .5);
}


I spent most of my time today messing around with some background visuals in the title screen. Blocks fall from above the screen in columns stopping before the bottom and stack on top of each other. Once the stack has reached the top, the bottom of the stack falls off the screen one by one. The last one to fall will stop right before the bottom of the screen and then the process repeats itself.

Each block that falls has a 20% chance of briefly flashing a green toxic glow. I messed around with that green flash further and made it cascade down each block in its column but ended up not using that.




Daily Goal

Navigation and Testing

I'm just going to work on navigation and whatever I find out of place as I go along. And if I finish that with time to spare, I'll work on story mode things like scores, results, and secrets.

Monday, November 17, 2014

Work Completed

The goal today was:
Get the RoomSelectWorld working

Result is success. There were a couple tricky bugs along the way and some things needed to be reworked. The rules of some GUI elements still need to be tweaked. I got sidetracked a lot and worked on a bunch of things I didn't need to but they all turned into improvements.



Daily Goal

Get the RoomSelectWorld Working


I don't think it should be too difficult. I already worked on it for about an hour last night. Once I have it working, I'm going to go strait to navigation work so I can more easily move through the game while testing.

Work Completed (11/16/2014)

The goal was:
Testing

A lot of testing was done. A bunch of bugs were found. Various things were adjusted and/or improved. It's a bit of a blur in my head this morning.

I made a couple more helpful functions in my base class EntityPlus and now have a pretty nice bundle of interactivity switches. They all affect any entity the caller has added to the world.

epActive() uses Entity's active property to turn on or off the update
epVisible() uses Entity's visible property to turn on or off the render (visibility)
epInteractive() turns the Entity's hitbox on or off

All three require one argument, a Boolean, to specify on or off. They can also take two optional arguments; _includeThis:Boolean = true in case you don't want the parent entity to be affected, and _exclude:Entity = null in case you want a particular entity besides the parent to be unaffected.

There's a fourth function to go along with this bundle: epInteractiveAndVisible() which simply calls both epInteractive() and epVisible().



Sunday, November 16, 2014

Daily Goal

Testing

After such a major overhaul, there are bound to be some problems. So I'm just going to test as much as I can and work out any bugs I come across.

Oh yeah, I might try to get the RoomSelector working again with this new setup. Currently clicking on the Room Select button in the title screen does nothing.

I also wanted to write about over complication. I think, naturally, when you're learning something you don't understand you over complicate a process even when the easier solution is sitting in the drawer right next to you. Some time back, while working on Taunt (I think it was), I added a Boolean property called 'busy' in my basic Button class. 'busy' was something I used to toggle the interactivity of a button object by simply changing 'busy' to true or false.

override public function update():void
{
    if (!busy)
    {
         updateInteractivity();
    }
}

Now, this could still come in handy if I have some things in update I want to run and some I don't but there's a Boolean property that comes with Entity called 'active' that toggles update. So I could have just set 'active' to false if I wanted to stop the interactivity of a button. And I've been using a Boolean property that comes with Entity called 'visible' for some time now which toggles the visibility of an Entity so that's why I say 'active' was right next to me the whole time.

Saturday, November 15, 2014

Work Completed

The goal was:
Rework the RoomDesigner class into PuzzleDesignerWorld

So, I did A LOT of work. A lot of renaming and moving things around. A lot of cleaning up and throwing out the trash. A lot of prep work in other words. Then it was more cleaning up and adding in code that would make a new world and pass the needed data to it.

After all that, on my first execution, the game started up and PuzzleDesigner loaded! Now it's to testing, ironing out components like the PuzzleNamer, and more testing. Then I can get to the navigation. Although, after this, I feel like I could finish navigation in like ten minutes easy.





Daily Goal

Same as yesterday:
Rework the RoomDesigner class into PuzzleDesignerWorld

RoomDesigner just feels like one big mess, but I think I'm ready to get at this after reworking GameManager, SwitchTile, and SwitchTileClient. I expect to have a much better understanding of it after this and. And I think that understanding will alleviate that messy feeling.






Work Completed (11/14/2014)

The goal was:
Rework the RoomDesigner class into PuzzleDesignerWorld

I didn't feel comfortable with reworking RoomDesigner without first reorganizing a good portion of the game's file structure and splitting the SwitchTile and SwitchTileClient classes each into two. So that's exactly what I did and was very pleased with how well it went.

After reworking the GameManager class, splitting SwitchTile and SwitchTileClient was a breeze. I wanted each to have one version for game play and one version for the puzzle designer. First I copied the class to have a backup. Then I removed anything in the original that was specific to game play and puzzle designer leaving only variables and functions that were needed for both. Next, in the backup, I put a comment marker next to each variable and function that was remaining in the original. Now, with a base class to work off of, I extended that into two separate classes. Finally, in each of those classes, I looked into the backup and copy-pasted anything specific to its scenario.





Friday, November 14, 2014

Daily Goal

Rework the RoomDesigner class into PuzzleDesignerWorld

I'm getting a pretty late start today so I'm not sure if this is going to happen but I'm going to look over it in hopes to find some motivation. I might instead start splitting the SwitchTile and SwitchTileClient classes each into two. One meant for RoomDesigner and one meant for Puzzle (game play). Right now there are many conflicting event listeners that make them difficult to manage.



Thursday, November 13, 2014

Work Completed

The goal today was:
Navigation and Testing

While thinking about navigation, I realized that I wasn't able to put off that needed revamping of the game managing classes. I started picking at some variables to see who used them and how important they were. After a while I got a decent feel for what was reliant on what.

I copied the head honcho GameManager class and then rewrote it. I liked how it looked so I took the plunge; broke the class into two, extended other classes from those, wrote some new worlds, and then executed.

There was a long list of errors that popped up but they were mostly just broken references which are easy fixes. A couple hours later sifting through those and the game is working!

So I'm feeling pretty comfortable about breaking everything up into separate worlds. There's the PuzzleWorld, the PuzzleDesignerWorld, the PuzzleSelectWorld, and the TitleScreenWorld. Tomorrow I'll be working on the PuzzleDesignerWorld which is the most complex.




Daily Goal

*draws from a hat*
Navigation and Testing

Actually, I think I'm going to pick at revamping some major classes. And I say "pick at" because I don't want to get lost in a sea of stealthy bugs and crashes. So I think one variable at a time is the way this will go.

The overall idea I have in my head about this is that I have only one world instead of several. That one world adds a few major classes that manage the major sections of the game. From what I understand, these major sections or classes should be separate worlds. And although I'm not going to change them into worlds, I want to have one class in the world at all times as a 'Game Manager' and then everything else will be added and removed to the world when needed. I believe this will help resolve various class and variable conflicts.



Wednesday, November 12, 2014

Work Completed

The goal was:
Finish Manual

Success. The manual isn't all I wanted but is complete. I threw out most of the text I thought wasn't completely necessary. The interactivity of it and certain sections of the game need to be tweaked so keyboard and mouse actions don't affect the background.




Daily Goal

Finish manual

In the process, I'm going to trim down the amount of text. I would like only one page of text for each section. This isn't a strategy game so I don't believe the user should have to read a novel to understand how to play it. With saying that, I should also look into maybe simplifying the controls? We'll see.

Also I would like to note that Lightbox (the Blogger app that overlays an image onto the page when you click on it) has stopped working on any post past November 9th. Searching for a fix, it looks as if it breaks about once a year. I really love Lightbox because even though I have to first upload images, it's my answer to Windows Photo Viewer. With WPV, if I want to view my images without an annoyingly bright background, I have to use the slideshow feature which re-sizes the images. I believe with Imgur, if I don't want any compression, I can't view my images in gallery form. Lightbox gives me a dark background, no compression is automatic, gallery viewing is simple keyboard arrows scrolling... Please stop being broken Lightbox.









Dang. Still doesn't work. 11/13/14: Found a solution in the forums. In the HTML code, in the image URL, the 's' in 'https' needs to be removed from both the 'href=' and 'src='.

Tuesday, November 11, 2014

Work Completed

Today's goal was:
Create an easy access manual

Holy cow that was a lot of work. The manual needs a lot of tweaking but it works.




I wrote out all the text into several multidimensional arrays. Each section of the game that needs instructions has its own page number which corresponds to an index of an array. So when the 'i' key is pressed, the manual is added to the world and it gets 'manualPage:uint' from the GameManager class. It uses that number to access the proper index of the arrays.



Daily Goal

Create an easy access manual

This is in response to my dissatisfaction with the look and function of the UI in general. The game is 800 x 600 only and the puzzle grid takes up most of that leaving very little room for UI elements. Having a manual that can be accessed simply by pressing a key like 'i' will free up some room and get rid of clutter. I may also work on navigation while working on the manual.




I have contemplated bumping up the game resolution but I think that's for a different time. Having a completed game is priority, optimization and certain improvements come after.

Monday, November 10, 2014

Work Completed

The goal was:
Get the Switch Tile Client Creator working with the Switch Tile Client Editor

Result is success. There were a few bugs along the way. Most being mismanagement of what got added and removed at various points and what should belong with what.

That add/remove mismanagement got me thinking more about code organization. I had built add and removal automation but still get confused in certain situations. This one being what I would call a multi-level GUI.

I'm trying to better understand this multi-level GUI by visualizing a grid of tiles with various different blocks placed on some of the tiles. I highlight only the ones that belong to a group. With those blocks in front of me, I am looking at an editing hub that gives two choices; add more blocks to the group or change the properties of any number of the blocks I picked out. Selecting either of these choices and making changes will need to be translated back to the hub. So, do I leave the hub open and halt any actions in it while editing or do I just consider the hub a third separate system that gets removed while editing?

Daily Goal

Get the Switch Tile Client Creator working with the Switch Tile Client Editor

I would also like to test various areas of the game to make sure they still work now that I'm using the new client creator.

I'm still bothered by much of the GUI, most especially the way information like user instructions are displayed. I was thinking about implementing a manual/instructions button with hot-key to bring up the manual. The manual may have several pages, each pertaining to a certain section of the game. Like the puzzle select area of the game, the user can simply press the right and left arrow keys to scroll through the pages or click arrow buttons on each side. Also, depending on what section of the game the user is in, pulling up the manual will go strait to the page containing instructions for that section.

Sunday, November 9, 2014

Work Completed

The goal was:
Get the new Switch Tile Client Editor working

It seems to be working just fine. Some things are off and some things need to change but it functions properly. I haven't had the chance to test much further than laying some clients down and clicking the 'DONE' button.



Daily Goal

Same as yesterday:
Get the new Switch Tile Client creator working

I would like to add to that goal to have the rest of the game working properly after implementing the new creator. I did pretty much have a full working game before I started this task. Revamping things can cause unexpected reactions and errors in areas that were previously working fine.

Work Completed 11/08/2014

The goal was:
Get the new Switch Tile Client Creator working

I completed most of the work and was sifting through some errors up until I had to leave. Everything I did is a bit of a blur in my head. A lot was changed and a lot was thrown away.


One huge change was the SwitchTileCustomizer class which had been handling just about everything with Switch Tile Client creation up to this point. Switch Tile Client creation is now handled by a new class called SwitchTileClientCreator. This class branches off into two children in order to handle two different situations; STCC_STC (for when a new Switch Tile is laid), and STCC_STE (for when editing the clients of an existing Switch Tile).

This does simplify things for the user and a lot of the code. I often come across areas of the game and code that could be restructured making things more; user friendly, dynamic, and robust. It's difficult sometimes to stop myself from getting distracted by those things and end up catching myself working on them instead of my task. I've read that you should focus on finishing the product first and then optimize later.

Saturday, November 8, 2014

Daily Goal

Get the new Switch Tile Client adder working

Getting the old one working was incredibly difficult in itself so I'm expecting this to be tough. It's always scary revamping something so complicated because the old version may have been put together like your refrigerator's ice maker. Why did you break?? And why does nothing in the manual fix you???



Friday, November 7, 2014

Work Completed

Today's goal was:
Add the ability to add clients in the Switch Tile Client Editor

Well, I certainly did work towards the goal but didn't work on it. While thinking about how I would make it work, I realized the process I currently have in place should be revamped. So I started working on a new way to add clients.

Laying a Switch Tile will not open any prompts. Instead, an image of the active tile type for the client will sit under the mouse pointer. In the upper left and right will be images of what the active tile type will be and what the inactive tile type will be. Each will have arrows to the left and right of them. These arrows can be clicked to scroll through tile types. The user can also scroll through tile types with the A, S, Z, and X keys. A and S for inactive type. Z and X for inactive type. The tile image that sits under the mouse will have the number of moves the clients will stay active. The user will be able to type in the number of desired moves.

Daily Goal

Add the ability to add clients in the Switch Tile Client Editor

Right now the only way to add clients is when a new Switch Tile is laid. This will automatically trigger a prompt that asks the user what type of tile they would like a tile to change to when a block touches the Switch Tile. Then another prompt will ask for how many moves do you want it to stay active. The user is then able to place clients on the grid.

That prompt and Switch Tile Client Editor are two completely separate classes. I would like to merge them into one system that allows the user to add, delete or modify clients. Today's goal however is to just give the Switch Tile Client Editor the add more clients ability.



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.