Sunday, May 5, 2013

Pause Complete!

It’s been a crazy week. Monday-Wednesday always pass quickly, so I only really got to work on Thursday. The week was gone so fast! Luckily I got a lot of work done yesterday, so I managed to at least basically complete the pause/debug menu. Both this and last week’s task were fairly UI oriented and don’t look the greatest, but we have an artist who should be good at that. Here’s a screenshot of the pause menu.

This week took quite a bit of wrestling with Gamemaker, even more so than usual. The basic idea was to have a list of variables that myself and playtesters could change to adjust difficulty etc. I wanted to store them all in just one list so it would be easy to swap in/out variables whenever I wanted. However, Gamemaker doesn’t support pointers at all. It used to have functions that would let you look up variables by name, but with the move to mobile, HTML5, and such these no longer exist. Eventually I resorted to just listing out each variable on in a switch statement. So, for those 5 variables above, I have a script getValue and setValue which have a switch from 0-5 that maps the 0th inputBox in the list to the GERM_SPEED_MOD variable in obj_constants, and the 1st to ENEMY_SPAWN_TIME, etc. A pain if I want to change up those variables and a pain to make and a pain in general.
Making the pause menu was pretty fun, though I had a few troubles with deactivating/activating objects. I sorted most of those out with delayed pause changes. The problem was I would reactivate instances, but couldn’t execute code in those objects using the with(object) construct that same step. To solve it I put called an alarm[1] event when pausing/unpausing, and the alarm[1] event would execute the with statements. Since the reactivation code had a chance to resolve, everything worked out. I’ve also now accepted the importance of alarm[0] ‘slow creation’ events that require other objects’ initial variables. By calling those 1 step after all the objects have been created, it’s assured that each object will already have run its creation code and will have variables the other object needs to check. For example, obj_menu and obj_player both play music in the ‘slow creation’ event that needs to check if obj_constants’ MUSIC_ON is true or false. (By the way, this functionality is mostly for myself because, as good as our music is, there’s only so long I can bear listening to it.)
This week things are going to start getting exciting. It’s time for playtesting! I’m going to be adding a feature or two and playtesting them. I already have a basic timeline set up for the tutorial, and I’ll expand that to work with the regular spawning code which right now is pretty much entirely random. So I’m gonna add a little more structure to that. This will also let me add unique challenges to the game – like flooding the screen with one color of germ, adding waves from one side of the screen, or spawning trackers to come in from multiple directions.

No comments:

Post a Comment