Total Hours: 4
Game can be downloaded @ http://students.umw.edu/~rrill4hf/. The file will be called Blobby.zip. You will need Dev-C++ and all that stuff for Allegro.
As you can tell from my post title I am very happy to get level switching working. It took me a good hour to finally get it right. The game did not like it when I placed the loading of the new level in my setupscreen function in setup.c. I think the problem is that I accidentally tried setting up the video mode when it was already set from the beginning. The next three hours I spent on reorganizing my code and making sure that none of the elements from level 1_1 messed with level 1_2. The following will be a more detailed explanation of what’s going on so far with Blobby’s World.
To get level switching to work I ended up creating a new function levelup in environment.c. First I needed to create a level variable[starting at 1] which keeps track of the player’s current level. Within this new function I have the game load the second MAPPY level and update level by 1. Currently the function also sets the alive status of the level 1_1 enemies and items to false. Even though I am using the same BGM as level 1_1 I decided on restarting the song because when I didn’t it felt like the two levels were continuous rather than separate. At this point the game is able to switch the level.
Last semester when I wrote my code I didn’t take into account other variables and instructions I would need for a multi-level game. As I tried to polish up the level switch I ended up deciding on cleaning up code just a little bit more since having multiple enemy instructions along with other code seemed to cluttered. I created a new enemy.c class that will tell the game how each enemy type will act handled by different functions. So far I have the function chump which dictates how the chump minions move and interact with the environment. The function chumpdata will be used to resetting chump stats depending on the current level. In addition to organizing enemy info I also created an item.c class which handles item placement within each level since I am expecting on using more power-ups for Blobby. Miscellaneous variable from last time were renamed such as the sounds array being split into sfx and bgm arrays. These name changes doesn’t affect game play but I just wanted to inform readers of name changes just in case there is confusion from previous code. All this shuffling around of code took me about three hours.
So far the new enemies haven’t been integrated to level 1_2 yet but I am hoping to getting to it tomorrow. I am still deciding on how the these new enemies should behave. I have been able to add the ability for the player to fall into pits and lose a life. This pitfall is a little buggy though. I ran through the game a couple of times and when Blobby would fall, half the time it works the other times I would get an error message and the game would have to shutdown. I am not sure where the issue is. Can anyone comment on this?
To end this post I will list the cheat sequence for the game if you never recognized it from previous posts of my code. This will be helpful if you just want to check out level 1_2.
Infinite Power: Press ‘c’ + ‘p’ + ‘o’ + ‘w’‘ simultaneously. This will give Blobby unlimited invincibility unless he picks up the Black Orb power-up.
Enemy Stop: Press ‘c’ + ’s’ + ‘t’ + ‘p’‘ simultaneously. This will stop enemy movement for the level.
End Jump: Press ‘c’ + ‘b’ + ‘y’ + ‘e’‘ simultaneously. This will place Blobby near the goal.
Also just so you all have something to comment on, any suggestions on level themes? I was thinking of fire for the next one.
Source Code: main.c, game.h, setup.c, input.c, environment.c, enemy.c, item.c, cleanup. c
February 12th, 2008 at 9:38 am
Sounds like those files I gave you helped