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.
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.
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).