Thank you for visiting Blazing Games

Block 2

December 26th, 2008

14:00 I was planning on starting this session an hour ago, but I got company so I will probably only put in the minimum of 3 hours today, but that is assuming I finish my goals for this session. So, what are those goals? Definately want to get the layout of the game done but working out the XML format that the puzzles will use and putting together a test puzzle is also important. Having the puzzle roughly playable would be a bonus, but I won't start on that third part until the first two tasks are done and if it is already past 3 hours then the

Lets start with the layout. I could hard code all the layout values but it is better to use constants so that in the future it is easier to change things if necessary. Hard coding values is a bad habit to have which is why I try to have a constants section of code that holds all the constants. Still, when there is a tight deadline, I have the nasty habit of putting constant numbers into the middle of code instead of defining constants for them.

15:00 The layout went quicker than I expected, and would have been even faster had I remembered to save my files before compiling. That is one disadvantage of using the free Flex3SDK instead of opting to use the Eclipse based FlexBuilder. Still, I code on three different platforms (Windows, OSX and Linux) and don't want to buy three copies of FlexBuilder so using the command-line tools is a necessity. Now on to the data file.

16:00 XML is easy enough, but it is often nice to test things by having the parsing program dump a bunch of info to the console. Of course, if you don't want to run the game through the debugger, you can always cheat by creating a text field and dumping the debug info to that. Just remember that the text field can cover buttons so make sure that it either doesn't cover them. I currently have the XML processing being done in a function called setPuzzleData, but that function is largely just dumping info which I no longer need to do but will leave that function in for now for reference (I'll probably remove the no-longer useful code next session) even though the puzzle generation will be replacing that information with new information.

17:15 I started to make good progress and at 16:30 I thought I had the puzzle generation code finished and would be able to start on the user interface code. Sadly, that was not to be as when I ran the code, it kept crashing giving me the Flash equivalent of a null-pointer exception. In other words, the program was crashing because one of the objects that was being referenced was null. No object means Flash doesn't know what to do. While Flash doesn't crash, it also doesn't do much or give you much information so this can be annoying. I spent the next forty minutes just examining my code not sure where there could be a problem. Everything looked fine to me so I was quite frustrated as to where the problem was. Finally I realized that my shuffling code was not using the right variable in the swapping somehow resulting in null values being placed into the array instead of the string that was suppose to be swapped. A few seconds to fix this typo and everything is running fine.

I probably should put in another half hour or so, but with the snow falling I think I will call it a day today. Tomorrow I plan on doing another session and the goal for tomorrow will be to have the game playable.

Previous page
Making Scrambled Pyramid Page 3

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2008 Blazing Games Inc. All Rights Reserved