Tuesday, February 28, 2012

More Leaderboard Stuff

Haven't been working on much code. I messed with the main menu of Color Coder a bit. I played with the spacing between buttons and added a nice looking Scoreloop one to get to that information. Still trying to get the Time Trial leader board working since the other two are good to go. The Scoreloop documentation makes it look like what I want to do is, in fact, doable. I just can't figure out how to do it. I also can't tell if it is possible to have an ascending leader board in the same game as a descending one (which I need). I can't be the only one who wants both types of leader boards in a game, so you would think it would be an option, but I have no idea how to set it up on the Scoreloop website. Then again, their controls for developers aren't terribly user friendly and when you click the little "i" information image next to stuff, it barely tells you anything helpful.

I posted a discussion on the Scoreloop support "forums" so now I just need to wait for it to be answered. This, however, could potentially be a while, so I will have to find something to work on in the meantime. I think it'll be trying to get the music in my new game working better. Right now it restarts the music every time you switch activities. Its fine once you get to the game page, but no good everywhere else. So, I'm going to try and get that all sorted out.

On a side note, I beat my high scores for both Color Coder classic modes with 14 on hard and a sweet 18 on easy, so that's pretty cool.

Monday, February 27, 2012

More Commenting and Scoreloop

So the work I've done in the last couple days has mostly been commenting and working with Scoreloop. My main game activity is commented really well (in my opinion), possibly too much in some places. I still have 5 other activities to comment, but they are much smaller and shouldn't be a problem.

I've also started integrating Scoreloop in to Color Coder. So far I have a working leader board for classic easy mode, but I need to make two more for classic hard mode and time trial mode. Scoreloop was pretty easy to integrate since they have some pretty good documentation that comes with the APK download, but their support "forums" are a bit lack luster. If you post a topic asking for help, it first has to be approved from moderation. Then you have to wait for a variable amount of time, up to 4 days that I've seen, to get any response from a member of the support team. As there are only 4 of them I can imagine that they get overwhelmed from time to time.

Regardless, I've got it set up so there is a leader board for classic mode of Color Coder. You can only have a single score on the boards and if you submit a score lower than your current score on the boards, it doesn't get updated. It seems weird to not just put all your scores up there since I'm used to Arcade style leader boards where one person can flood the screen if they are good enough. This setup makes more sense though, especially since I expect that most of the people on the top scores list to have the same score, at least on Classic Easy and Hard modes. On Time Trial I think there will be a bit more separation. Now I just need to get the other two leader boards set up and get a new button image on the main screen for Scoreloop stuff. Otherwise, Color Coder is pretty much set up for an update including Scoreloop leader boards, hopefully in the next week.

Saturday, February 25, 2012

Tweaks and Commenting

Today has been pretty boring so this will be a short post. The only thing I did to the game was altering the position of some text so that it is better centered and such. I've also been doing inline comments to better document the code, but there is still a lot to do there so it will take quite a bit more time. The game is almost done and up until this point I haven't been taking a whole lot of time to any inline commenting so I need to get that going before I forget why I did certain things.

Friday, February 24, 2012

Splash Screen, Sound Effects, and Music

Today I added a couple of smaller features on my way to finishing up the game: a splash screen, sound effects, and music. All three things were quite a bit simpler to add than I thought they would be.

The splash screen wasn't hard once I figured out what I needed to do. I looked over some example code I found, but it was from over a year ago and some of the object names and such have since been changed, so I had to look up what the new names were, which didn't take long, but it would be nice if some of the examples I've been looking at were current at all. The splash screen just shows up for 2 seconds when the user first starts the game. The screen shows an image of the Downplay Games logo along with the AndEngine logo in the lower right. The image zooms in a little bit over the course of the 2 seconds the screen is shown.

The sound effects were also fairly easy to add. Since I already had the Sound On/Off settings flag implemented, it was pretty simple to add in a couple if statements checking if the sound flag was set, and then it plays the sound. I added in sounds for starting a game, selecting a tile to destroy, chains being destroyed, tiles being respawned, and the game ending. Currently they all play the sound file since I don't have any other files ready.

Similar to the sound effects, the music settings flag was set up already so getting the music to play was easy to implement. All pages in the game play it if the music setting is on. Unfortunately, the song restarts every time the game switches to a different page. I'm also using a place holder song for now that just loops repeatedly. If the player pauses the game on game page, the music also pauses. The music toggle button on the settings page does the same thing: the music plays when the music toggle is on and pauses when it is off.

With these additions, I'm tempted to say all the critical aspects of the game are now complete.

Thursday, February 23, 2012

Game Modes 2

Yesterday I finished up with two major aspects of the game: Time trial mode and high score message boxes. The message boxes appear in the middle of the screen when the player has scored a new fastest time in Time Trial or a new high score in Classic or Casual.

In time trial mode, the player has unlimited clicks and the object of the game is to get to 15,000 points or more as fast as possible. A stopwatch style counter starts when the player starts the game and ends when they reach 15,000 or more points. My fastest time so far is 1:26.880. Adding time trial mode to the game was a bit time consuming, but I was expecting that. Getting the timer to pause and resume correctly was *way* easier than I was expecting.

Time trial mode is pretty fun. Since you don't have to conserve clicks, you can just set yourself up for much larger chains, where in casual or classic, setting yourself up for a larger chain might not be worth the extra clicks you spend to do so. Without having to worry about how many clicks you have left you can make large chains all game, as long as you do so quickly.

Getting the high score/fastest time message boxes to pop up at the correct time was actually much more time consuming than I thought because I was actually checking for high scores in multiple places, both when the timer ran out and when the user was out of clicks. Now, it basically checks when the last tiles are respawned after the game end condition has been met.

Earlier today, I also did some quick work to add a "Quit" option on the game screen pause menu. Now, when the player presses either the menu button or the back button on the game screen, the pause menu will pop up. When the player selects the Quit option, they are taken back to the main screen of the game.

I feel like the only main things I need to add now (besides better graphics) is music/sound effects and a Downplay Games splash screen when the game first loads. Then an addition I was thinking about making was some sort of point text that appeared when a chain was made to give feed back to the player as to how many points they've received. In this way, the player would get a feel for how different chains are rewarded more than others and how causing multiple chain reactions is more beneficial. That being said, I also feel that there is a lot of chain reactions and tiles falling in different directions, etc, and putting a bunch of text numbers over the top of it might get really busy and make the board too crowded. I'll have to play around with it later and see how I feel about it.

Wednesday, February 22, 2012

New Game Modes 1

Yesterday I started working on different game types, specifically the "Casual" mode. In casual mode, there is no time limit and the player has 25 clicks to get as many points as possible. Its a mode for when players want to take their time and really think out their moves.

Since I started putting new game modes in, I also added some personal high score tracking. Currently the game is saving high scores for Classic and Casual modes. The game type selection page now shows the high score for currently selected game type. The high score text is displayed on the bottom of the game type description area. My new Classic high score is 13236 and my Casual high score is 14296.

When the game is in Casual mode, the time display is shown as the infinity symbol. When the game is in Time Trial mode, the clicks display is shown as the infinity symbol.

The stop watch functionality of Time Trial still needs to be implemented and then a fastest time needs to be saved. I also need to add some sort of new high score/fastest time dialog box that pops up when the player breaks their records.

Tuesday, February 21, 2012

Non-Game Pages.

Had a pretty productive day yesterday. I added 5 activities to the game: main menu, help page, story page, settings page, and a game type page.

The main menu page is straight forward. There's a large button for play that takes you to the game type selection page, and then 3 smaller buttons for Story, Settings, and Help.

The settings page has two toggle buttons for turning off and on sound effects and music, except there isn't actually any sound effects or music in the game yet. It also has buttons that will take you to the Downplay Games facebook, twitter, and website, as well as a "More Games" button that takes you to our page in the Android Market.

The help page and story page pretty much function the same way. They are basically slideshows that you navigate by swiping the screen with your finger. at the bottom left of the page in small text I put a note that says "Swipe to Change Page" just in case the user doesn't automatically get that. Also, in the bottom right there is a page indicator, that says for example "Page 3 of 6", to provide a little feedback so the user doesn't keep swiping when at the end of the 'slides'. These pages will show the help page images and ones depicting the back story of the game.

The game type page is the page displayed right before you get in to playing the actual game. It will be here that the user selects their game mode. I currently have 3 game modes shown. Clicking any game mode button highlights the button's frame in different colors, and obviously clicking a different button removes the highlight from the previous button and places it on the current one. In addition, an image that takes up the right portion of the screen also displays a description of the highlighted game mode. Clicking a game type button that is highlighted takes you to the game page, though the different game modes are not yet implemented.

Getting the new game modes in are next on my list as the various new pages are pretty much finished besides adding proper images and sound effects. I'm also going to be adding some personal high score saving pretty soon. On a side note, my new high score for what should now be considered "Classic Mode" is 13050.

Sunday, February 19, 2012

Restart Menu and Bugs

So today I worked on changing the pause screen to a pause *menu*, which looks the same, but is actually handled differently in AndEngine. So now, the same pause image pops up (actually it fades in now) but below it there is a smaller, similar image that says "RESET" and clicking it resets the game, obviously. It actually took me a couple hours to get the pause menu set up and working properly with the reset functionality, but that was mostly because I had a hard time actually figuring out what the menu code was doing. In hindsight, it is pretty simple.

After I got that all figured out, I play tested for a while, and found that "pausing" at certain times during the game caused a few or all of the tiles to remain visible when the pause menu was up, which shouldn't happen. You could also sometimes get it to show the board after the reset option was chosen, but before the tiles went through their spawn animation, so you could look at your board before the game was started, which is another thing that shouldn't happen. After playing around with it for a while, I determined that it was specifically pausing while the tiles were sliding that caused the issue. I attempted to fix this issue in vain for at least an hour, probably closer to an hour and a half or two, by adding all kinds of sections that made all the tiles invisible and checks to see if the game was paused or not. None of these options were working and I was getting pretty frustrated.

Luckily, the easiest solutions are often the best ones, and I decided to simply not allow players to pause the game while tiles are actively sliding around the board. All this really means is that after making your move, you just have to wait for all the chains to fall before you can pause, which I think is fine. although some people who are in a hurry for some reason might be confused as to why they can't get the game to pause. So now when you've played a game and its all over, you can bring up the pause menu and restart your game instead of leaving the app and loading it back up, which was the only to start a new game up until this point.

A little more play testing is needed, but I think the addition of the pause menu just about wraps up all the functionality for the actual game play. Now on to the exciting world of main pages and settings menus.

Saturday, February 18, 2012

Timer and Pausing

While I didn't get anything super exciting done on the game yesterday, I did get some good features added in.

First of all, I added a count down timer so the player has a time limit as they play. I started with 2 minutes, but I found that was actually plenty of time to use 20 clicks, so I lowered the time to 1 minute 30 seconds, and that seems to be right on the mark. I've play tested more than a few times, and I've actually run out of time in a couple games with 3 clicks left to use. So, as a result of adding a time limit, the hourglass animations now changed based on remaining time, and the game ends when either the time runs out or the player is out of clicks (which ever comes first).

Now that there is an actual time limit, I didn't want players to be able to see the board prior to starting a game, so now the game starts when you click the start button above the hourglass, or the hourglass itself. Then the entire board is filled with the tile respawn animation and the game is on. My new high score with the set up is 12310, which is only 62 points lower than my previous high score, but I had a really lucky game with several high scoring chains.

The second cool feature I added was the ability to pause the game. When the player presses the menu button on the device, the game timer stops ticking down, the tile board goes invisible, and a "PAUSE" image shows up in the middle of the screen. So far it has come in handy several times when I've had to sneeze in the middle of a game. I made the game board go invisible so that players couldn't just pause the game to plan for a second and then start the game up again. I think that is a pretty straight forward choice and it works out pretty well.

The next thing I want to add to the game is a menu on the pause screen with a button to restart the game. Instead of making the player go back to the main menu page to start a new game, they should simply be able to pause and select the restart option. This will work while in the middle of a game or when the game is over.

After the restart option, pretty much the rest of the game is getting menu and setting pages done, and then a couple extra game modes.

Friday, February 17, 2012

Points and Hourglasses

I feel like I made some good progress yesterday. I added in some scoring functions that take in to account chain size and what I've come to call "Chain Generation". The main chain scoring function is a pretty simple recursive setup, but man, is recursion cool. Its always fun to play around with, provided it doesn't get complicated enough to induce headaches. There were a couple bugs at first with my score calculation equation (wasn't totaling up to as much as I wanted to) but they were easily remedied and the scoring is now just how I want it.

Oh, there was also a "bug" I fixed with respawning tiles where I wasn't checking a certain case that would lead to it spawning a tile in between 2 matching tiles (forming a chain of 3), which shouldn't happen. Anyway, that was a quick fix once I tracked down the problem.

I also added a super simple "Player" class that holds stuff like score and the number of clicks the player has left, in addition to respective text displays on the screen. Currently you start with 20 clicks (which I think is a good amount) and the game "ends" when you have no more clicks left. This makes the game actually playable now that there is both scoring and the game doesn't go on indefinitely. My current high score is 12372.

I've started working on an animated hourglass display for the time. The concept fits really well with the theme of the game, but right now I don't have an actual timer in the game. So for now the hourglass animations change based on the number of clicks the player has left and every 4 clicks the player does, the "sand" in the top half of the hourglass goes down, the bottom half fills a little, and it animates between 2 frames that make it look like sand is pouring down. I think once I've added the timer, I'll also add a text display of the time beneath the hourglass as well so the player knows exactly how much time they have left instead of having to gauge the hourglass. This makes it sound a bit like there is no point to the hourglass if the seconds are just shown on the same screen, but I feel like the hourglass will benefit the game aesthetically, fitting in with the theme well, in addition to giving the player a sense of urgency as they see the sand in the hourglass slowly sift down.

Getting the timer added and synced with the hourglass animation is really the last step I have to finish to get the game to full functionality. Then I plan to add a personal high score saving, hopefully with a leader board later on (Tim and I have been looking at Scoreloop), and then start working on some pages: main menu, settings, etc. I'm hoping to make a pause screen since AndEngine seems to have a good setup for that.

I also eventually want to add some different game types. I'm thinking a mode where there is no time limit so its a little more laid back people can think things out, and then also some sort of Time Attack mode where you have unlimited clicks and you have to see how fast you can get above 15,000 points or so. The latter mode would probably shave a few seconds off your time depending on how few clicks you used.

So, yeah, that's what I have going on.

Thursday, February 16, 2012

New Posts and New Games

I don't quite expect anybody to read this, so I suppose it will act more as a journal of my game development progress than anything else. I've been playing around with java and working on mobile games for the Android platform. Prior to starting work on Android apps I had no experience with Java, but had a strong background in C++, so the biggest problem has been getting used to the new syntax.

I started by making a couple games with basic Android layouts and image views. Little puzzle games that didn't involve anything fancy, but were fun to play and worked pretty well. With the help of my friend Tia working on the graphics for the games, they turned out pretty nice. My first game, Color Coder, is in the Android Market.

I've since moved on to working with AndEngine in the hopes of making more complicated and visually better games, using crazy new inventions like moving, animated sprites. AndEngine is a great resource for people like me, that enjoy working on things such as game logic, but very much dislike working on low level things like getting sprites to animate properly or having them react to gravity.

The current game I'm working on is a bit like Bejeweled in the fact that tiles will fall and chain with each other in a similar manner, but the game is played in a way that is different enough to set it apart from Bejeweled clones. Its working for the most part as of this post, but I have yet to add scoring or a timer, so right now its an infinite play game with now points. Games don't have a point if they don't have points, so I'll be adding a scoring system later today. The game also isn't much visually since it is currently comprised of sprites and backgrounds made using my awesome MS Paint skills, but the sprites are good enough to tell what you are doing until I can replace them with good looking images. I've already pseudo-coded most of the scoring algorithm, so it should be pretty smooth to add it, and once I put a timer in the game, it will be fully playable though subject to future tweaks.

I'm feeling pretty excited about this game, and really looking forward to working more with AndEngine.