Doing My Part

I really haven’t done any development for Resistor in over a month, so I decided to go ahead and put it into the Peer Review process on the Microsoft Creator’s Club site.  I see it as my way of doing my part in adding to the fine collection of interactive video entertainment titles in the XBox Indie Games marketplace.

With over 400 entries into the Dream Build Play competition, I don’t think I have a chance at being one of the finalists.  If the competition was based purely on uniqueness I think my game would fare better.  However as in real life, looks do matter and my game is about as plain as it gets.

Overall, I would be thrilled if my game could make $100 on the marketplace, which would equal the original investment that I made for the Creator’s Club membership.  Unfortunately, I’ve heard that most XBLIGs don’t make anything, so my goal is probably a bit of a stretch.

Below are the changes I made to the game after putting it through playtest a few weeks ago.

Tutorial System

Tutorial tips were added to teach new players the rules of the games.  These tips should not display as long as the player is doing well in the game.  The tutorial tip system keeps track of which tutorial tips the player has seen, and it doesn’t display a tip that the player has already seen.  However, once the player quits the game the tip flags are reset.  A tip is displayed if the player falls to the B rank in any of the three categories.  Also, if the player doesn’t use the appropriate resistor and gets a Game Over, then a tip will display when the level is started again stating that resistors should be used to reduce the flow value.

More Graphical Improvements

Made the spinning light sprite display while the LEDs are filling, using the scale parameter.

The rank letters at the end of the stage now zoom into position.

Changed the A, B, and C rank colors to use lighter shades of blue, green, and red.  The status icons in the lower right portion of the screen now change with their respective rank values.  I also modified the real time rank value of the luminosity category, so that it calculates the rank based upon the maximum possible luminosity of activated LEDs (instead of all LEDs).  This way, the player starts out with an S rank in luminosity and the rank is only lowered if they connect a wire with a lower flow needed by the LED.

Audio Changes

Used Audacity to make the ding sound when an LED is activated lower based on the difference between the maximum flow value and the current flow value.  The rank grades at the end of the stages use these modified sounds as well.

 

Home Stretch

Small Glitch

Fixed an issue that actually only occurs on one frame of the fill animation.  This happens when a wire goes to the “filled” state, but the neighbor wires have not yet begun filling.  Since the wire is filled, it doesn’t make any connections to neighbors that don’t have the same flow value.  Since the neighbor doesn’t have a flow value initialized yet (assuming it is defaulted to zero), it’s flow value doesn’t not match the flow value of the wire that just completed filling, therefore it will not be connected.  However, on the next frame the empty wire will begin filling, using  the flow value of the filled wire which will make it connected again.  This flicker was quick, but it was noticeable.  Therefore, I added special checks for this case, and made the wires connected in this one frame case.

The Night the Music Died

Used the Pause method on the MediaPlayer to pause the music when the pause screen is active.  Unfortunately, there is no MediaPlayer property to determine if the music is paused, so I had to create a new variable to track if the music was paused.  I simply want to resume if the GameLevelScreen is coming from the pause state, but I want it to start playing anew if it is coming from the title screen or level select.  Also had to set this pause variable to false if the user quit from the pause menu to the main menu, otherwise it would still think that the music just needs to be resumed.  When that happened, it would try to Resume the title screen music when the level started.  The title screen music would just continue to play during the level, and the level music would never start.

Centering Text

Overloaded the drawRaisedString method, so that it now takes six arguments with the last being a boolean signifying if the text should be horizontally centered at the point passed as a parameter.  The drawing code is now in the six parameter method, and the five parameter method of the same name just calls the six parameter method with the boolean set to false.  This will keep me from having to change every line of code in the game that uses the drawRaisedString method.  Plus, I just add “true” as an extra parameter for the text that does need to be centered.

Background Colors

Fixed the background colors for level 4 (yellow) and 5 (green) so those aren’t so bright.  Also created a standard method in the LevelDefinition class that returns the background color, since that color was previously being determined in two different locations.  Updated those locations to use this new standard method.

Added columns of stars in the background which scroll if the player achieves the star rank (S Rank in all three categories at once).  Stars in the even number columns scroll in the opposite direction of the stars in the odd number columns.  I used Inkscape to make the stars since there was no easy way to make a star shape in Gimp.  Then, I just took a screenshot (PrintScreen button) and pasted into Gimp, because copy-and-paste from InkScape to Gimp doesn’t work.  I then used the fuzzy select tool to select the star, set the selected star region to white, inverted the select and set the remaining to transparent (after adding transparency to the layer).

 

One thing that I do like about C Sharp is that after some research, I found that structures (such as Vector2) can be passed by either value or reference.  At first I found it passed by value, when I tried to pass my star position to the getStarPosition method, but it left the position at the original value after the method completed.  Then I found that just using the ref keyword in the method parameter list and in the method call will make it pass the Vector2 by reference, which allows the method to modify the original Vector2 passed to the method.  This was necessary for me to make a trailing star effect, for the blinking stars that circle the results.  After trying a few different things, I thought the best look was two groups of three stars that circled the result screen.  Also, the yellow alternates between the three stars in each group.

More Effects

I also added a glow effect, so that the wire transitioned from yellow to white (four different shades) every 15 frames.  I didn’t like how it looked, so I just set it back to solid yellow.

Using the sprite scale parameter, I was able to make a light layover expand inside of the LED circle.  This gives the appearance that the LED is filling up.  The default color for an LED was set to light gray (previously white) to give a better contrast between the expanding yellow inner circle sprite and the rest of the LED sprite.

Spamming not Allowed

Cooldowns

Made another gameplay change today.  The fact that the player could pick a high level resistor and spam it to quickly complete the level was really bothering me.  Thefore, I added an array in the GameLevelScreen class which holds the cooldown value for each selectable piece.  When the piece is dropped, the cooldown value for that piece is set to 2 seconds (120 frames).  That value is decreased by one on each update until it reaches zero, then the user may place that resistor again.  So now the user can still use all resistors, but it will take a really long time to complete the stage, which solves the problem of the player winning the stage quickly if all resistors are used.  Using all resistors will also not give the player the best luminosity score.  I could put in a limit on how many times each resistor can be used, but I think that would over-complicate things.

Active Screen

A new abstract method has been defined in the Screen class, which is setActiveScreen.  This is a method that I already had in the TitleScreen class, but I thought it should be included in all Screen classes.  This method is called whenever the Screen gets set as the currentScreen.  Initialization that needs to be done whenever the screen gets control (such as setting pause values) can be set in this method.  This was going to be necessary for both the GameWinScreen and GameOverScreen, so I thought it was best to have it as a common abstract method.  Those two screens now have a pause instance variable that is set to the wait time in the setActiveScreen method, which prevents the player from bypassing the screen until that pause value hits zero.  This will also allow me to just call setActiveScreen on the currentScreen object once when control is passed, and I won’t have to call that method specifically for each Screen subclass instance.  I already had a setCurrentScreen method defined in the Screen class, but it is not abstract and its job is to set the next screen state to -1.  I think having the setActiveScreen abstract method handle the subclass specific code is best for now.

Title Screen Completed

Added a new background image for the currently select main menu item.  Used Gimp to create a free selection shape on top of one of the computer card images.  Used the color tools to make the image grayscale, and then increased the brightness twice.  Then I applied the bevel filter twice, and drop shadow filter once.  Also gave the currently selected item ‘s font a green color, and changed the font to Motorwerk.  Unless there is a good reason to change it again, I’m considering the title screen done.

 Loose Ends

Made a slight modification to the level complete sound effect, so the pitch gradually raises through the sound clip.

Added delay when an LED busts before moving to the Game Over screen.  The LED is now filled with red when it is busted (could use a cool breaking graphical effect later).