Friday, March 29, 2013

Robot Birds and Razor Blades

I've made a couple more levels in my scrolling shooter game, but for now I'll just go over what is currently the 5th level. In this level, the enemies are robot birds. There is the "Layer" class and the "Boomerang" class of minion. The Layer gets its name because when it is killed, it leaves behind (or lays) a robot egg pod thing. The player must kill this also or in 3 seconds it hatches into a miniature version of the Layer called a Hatchling. With the Boomerang class, their projectiles are quite unique for minions in the game. They shoot out their spinning razor blade bullets, which go out to a specific distance from the bottom of the screen and then hook back and leave the screen at the top. Basically the bullets follow a tight, long U shaped path and if you aren't paying attention, you can get hit by the returning bullet that you previously dodged. Overall I'm pretty happy with this level. The enemies are unique and it is pretty challenging. Right now it is only level 5 (I want to get at least 10 levels in the game upon release) but I think I might have to move it back to be later in the game on account of the difficulty level. Below are some pictures of my crappy MS Paint robot birds (the background is my crappy test background

Friday, March 22, 2013

Pink and Yellow Ghosts

So, I've been doing some more work on the game, but I haven't added in that level select menu. I have, however, I've completed my ghost level. There are two types of ghost minions, as with all other levels. The first ghost minion class is called the "Fader" and it is currently a pink guy that shoots normal bullets, but the thing with him is that he is in his transparent white/invulnerable mode most of the time, so you have to wait until he 'materializes' to kill him. It really just becomes an exercise in timing to take these guys down. The second minion is the "Confuser" class ghost and they look similar to the Faders but they are yellow. These guys shoot normal bullets like the Fader, but they also shoot a yellow confuse ray bullet. These bullets don't damage the player, but it applies the "confusion" debuff I added to the game.

The Confusion debuff screws with the player's controls. It turns the player a yellow hue so you know whats going on, but it also reverses the player's control in the X direction. So, if your finger is on the right side of the screen, your player sprite will be on the left. It doesn't mess with your controls in the Y direction though. That would be too mean. The confusion lasts for like 3 seconds and then it wears off. You get a half-second shield at the beginning and end of the confusion, just as a courtesy so that the sudden change in location of your sprite doesn't make you run into 5 bullets on the other side of the screen. Below are a couple screenshots of the new minions.



There's also a quick graveyard/fog background going on, but hopefully it will be something cooler in the final version. I still want to get a few more of my level ideas completed, but I really should start working on the level select menu I've talked about. These levels are starting to pile up and even though I can skip through them, its still kind of annoying when I need to test the same level repeatedly. I'll see if I can resist the urge to add more minion types and actually get some menu work done.

Thursday, March 14, 2013

Shields and Slimes




Well, I got a lot of what I mentioned in my previous post completed. When the player takes a hit, the phone vibrates for something like .125 seconds (oddly, fractions of a second longer felt like it was too long). In addition, when the player takes damage, their sprite will now flash red for a split second as further feedback that they were hit. In the screenshot below, the player sprite is flashing red because it has just collided with an enemy minion.
 I also implemented the shield feature I wanted to get in there. Minions now have a chance to drop the shield powerup, and should they player collect it, they are rewarded with 5 seconds of invulnerability where colliding with enemy sprites will not damage them, but will also not hurt the enemy minion (it will however remove enemy bullets from the screen). If the player collides with a boss, they will be given a similar shield that only lasts 2 seconds, but gives them enough time to reposition their sprite where they won't be hit by the boss again. In the screenshot below, you can see the dashed oval of the shield around the player sprite, along with some new minion types that I will be getting to.
I've added another level to the game. This one is composed of squirmy black slime creatures. The two minion classes for these guys are "splitter" and "exploder". The splitters are the ones shown in the screenshot above. When you shoot them, they split into two smaller versions of themselves (designated as "splits") that must also be destroyed to advance. These guys don't shoot to much because the number of enemy bullets can get quite overwhelming to deal with when you have a bunch of splits swirling around. The second class of minion for this level is the exploder. In my temporary paint graphics, they look like black squids, as you can see in the screenshot below. These guys explode when they are killed, releasing 3 bullets out , so if you kill a wave of them in quick succession you have to deal with a wall of bullets coming down towards you.
For my next level, I'm going to try to make some ghost type minions. I'm not sure what their unique little deal is going to be yet, but at least one of the types will go invisible or transparent. I'm learning a lot about AndEngines various modifiers with this project and I think I will be able to do some cool ghost stuff with the AlphaModifier. I also need to start thinking about making a level select menu page now that I'm starting to get more and more levels going. I rigged the menu button on the device to skip you to the next level but I'm going to need a level select menu eventually anyway, so I might start playing around with that soon. I have some interesting boss ideas so I'm looking forward to implementing those as well. Still a long way to go, but the project seems pretty promising so far.

Saturday, March 9, 2013

Multiple Levels

My recent work on my scrolling shooter game has resulted in both levels being playable, without having to change any code and reinstall the game. As I've been wanting to do, I have added the code needed to switch levels once a boss has been defeated. Since there are only 2 levels in my game right now, it isn't particularly hard to beat the game, but I can easily see this amount available in the Lite version of the game (with some better graphics and a few additions of course).

I also added some pathing for the player sprite when a level begins and ends. When the level starts the player's sprite rises on to the screen from the bottom. There is an image on the HUD displaying what the current level is. After a couple seconds, this display disappears and the player assumes control of their sprite. Similarly, when the boss of the level is defeated, the words "Level Cleared!" are displayed, and the player sprite follows a path off the screen at the top. The level of the game then increments and the next level is handled in a similar fashion.

Everything seems to be going pretty well and the game is nice an playable at present. I might need to look into my level progress bar again as it seems to be a little off at the end of the game. It might be a threading issue, but it isn't currently on the top of my priority list, so I'm not too concerned. What I am more concerned with is how to handle a collision between the player and a boss sprite. It was a non-issue with player/minion sprite collisions as I simply damage the player, kill the minion, and the game continues. However, since I can't just kill off the boss during a collision, it becomes more of an issue. I currently have the player being "teleported" back down to the very bottom of the screen if they collide with the boss, hoping to move them out of the way. If they were simply left there, another collision between the boss and the player would be detected and the player would be dead before they understood what was happening. This method worked pretty well, until I made the second boss dive low on the screen. When the player is teleported, they are still (at times) within the collision distance to the boss, so they still get hit multiple times. Obviously this isn't good for the player because they should always be able to tell when they are being hit. As a result, I've decided to trigger 2-3 seconds of invulnerability when the player hits the boss. They will still take a single hit of damage, but assuming they survive that hit, they will not take damage for another 2-3 seconds. When I have this functionality added, I will also be able to make a 3rd powerup that allows the player several seconds of invulnerability, similar perhaps to a star in any of the Mario Bros. games, but I likely wont give the player the ability to destroy minions via collision while in the invulnerable state.

Keeping in line with my thoughts on making sure the player realizes when they take damage, I'm also going to cause the player's device to vibrate whenever they take a hit. There will be a button to toggle this feature off in the eventual settings page, of course, but I think it is something most players will benefit from leaving on.

Wednesday, March 6, 2013

Points and a 2nd Boss

I've recently completed my second level boss. I find it to be sufficiently difficult. It shoots two large bullets at diagonals in a similar fashion to the sprayer class minions that constitute half of the level. He also dives quite low on the screen at times similar to the striker minions on the level. I think its a fitting boss fight.

Also, I added a point system. Its pretty straight forward: the player gains 100 points for killing an enemy minion, they lose 20 points for taking a hit, and get 1000 points for defeating a boss. In addition, the player loses 10 points every 1.5 seconds, resulting in a higher score the faster you complete the level. It works out pretty good, but also allows for some differentiation between player scores on a future leaderboard.

In addition, I altered the way minion spawning works. Previously, it simply assigned a path to the minions based on how many were in the wave, which got to be a little bit to predictable for my liking. While I want the minions to be a little bit predictable (so that the more you play, the easier it is to defeat them), I also don't want the game to go stale after only a few plays. So, now the game "shuffles" the paths before assigning them to a minion. When the max number of minions is spawned, the player will see no difference, but when only say two or three minions are spawned, they will randomly be assigned one of the available paths. This will cause the minion path combinations to be different from time to time, which is exactly what I'm looking for.

Saturday, March 2, 2013

Bosses and Explosions

I've recently made several exciting additions to the scrolling shooter. First of all, I added the explosions I wanted to get in there. Now, when you kill an enemy minion, the sprite is quickly replaced with an animated explosion. Its simple enough, but I actually ran into some annoying problems with it when I was adding it in. It turned out to be a rather simple threading issue, but it took me quite a while to track down after a decent amount of debugging, so that was annoying. Everything is fixed now and the explosions are working quite well.

I've also been working on getting some bosses added to the game. I have some cool polymorphism going so that I can have each boss be a separate child class of my base "Boss" class. The first boss is pretty easy, moving from left to right on the screen, occasionally shooting overly large bullets at the player. they are easy to dodge and the pattern they are shot at is very simple, but that's pretty much what I'm looking for out of a first boss. In addition to the boss, I've added the bar I mentioned in my last post that shows how close to the boss the player is. A small icon moves up the bar and when it's at the top, the boss appears. I also made it so that when the boss appears, this "progress bar" is replaced by the boss's health meter. Making use of the above mentioned explosions, when the boss dies it is replaced by 6 explosion animations and the player beats the level.

I've created minions for a new level, but the game only plays one hard coded level at a time. Currently I have the second level's minions combined with the first level's boss. The second level minions are bugs that come in two classes that I have deemed "Sprayers" and "Strikers". The Sprayers shoot two slow-moving bullets at a time at diagonals. They don't shoot very frequently, but there ends up being quit a few bullets on the screen when there are multiple Sprayers flying around. The Striker class minions don't shoot bullets at all, but their movement paths cause them to dive very low on the screen and the player has to either kill or dodge them as they make their charge. These minions also tend to move quite fast so the player has to have quick reflexes. In the screenshots below, the green bugs are the Sprayers while the red ones are the Strikers, both flying around above my MS Paint lava flow background. The red and gray triangle is the player sprite and the small blue triangles are the player's bullets.

My next objectives include adding in a point system, making the second boss, and then getting the game to the point where a second level starts when the first level is beaten. From there I can start working on even more levels with more exciting minions and different bosses.