You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your first bug! What an exciting moment 😃!!! I'm so proud I might 😭.
This bug is pretty easy. It's meant to get you familiar with GitHub and the Invaders code, and get you off to a running start. Let's get started!
Compile and run your program.
Problem
Nothing shows when we start the program 😱! Don't worry, we'll get things working.
Nothing is showing because I removed the code that shows the first screen. You need to add it back to fix this bug. When this bug is fixed, running your code should show the TitleScreen.
Where Is The Problem?
File: src/engine/Invaders.java
Function: run()
Instructions
Open Invaders.java then find the run() function. You should see something like this:
// Get a list of levels to playList<GameSettings> levelSettings = Levels.getLevels();
// Hold on to all of the game's informationGameStategameState = newGameState(1, 0, Constants.MAX_LIVES, 0, 0);
// Show Title Screen below this line
For now, ignore everything above // Show Title Screen below this line. We won't use the code above that line until bug #3. In this bug we want to create and show a new TitleScreen. To do that, follow these 2 instructions:
Below // Show Title Screen below this line create a new instance of TitleScreen and store it in a variable called screen. Your code for this step should look something like this: Screen screen = new TitleScreen();
Now that you have an instance of TitleScreen stored in the variable screen, show it by calling screen.show();. Your code for this step should look something like this: screen.show();
After completing the above 2 steps run() should look something like this:
// Get a list of levels to playList<GameSettings> levelSettings = Levels.getLevels();
// Hold on to all of the game's informationGameStategameState = newGameState(1, 0, Constants.MAX_LIVES, 0, 0);
// Show Title Screen below this lineScreenscreen = newTitleScreen();
screen.show();
Compile and run the updated code. You should now see the title screen when the program starts:
Congratulations, you just fixed your first bug 🎉 🎈 😃!
After you have fixed this bug:
Commit and push your changes to GitHub
For groups, have each group member sync, run and test the latest code to make sure everything is working properly.
Your first bug! What an exciting moment 😃!!! I'm so proud I might 😭.
This bug is pretty easy. It's meant to get you familiar with GitHub and the Invaders code, and get you off to a running start. Let's get started!
Compile and run your program.
Problem
Nothing shows when we start the program 😱! Don't worry, we'll get things working.
Nothing is showing because I removed the code that shows the first screen. You need to add it back to fix this bug. When this bug is fixed, running your code should show the
TitleScreen.Where Is The Problem?
File: src/engine/Invaders.java
Function:
run()Instructions
Open Invaders.java then find the
run()function. You should see something like this:For now, ignore everything above
// Show Title Screen below this line. We won't use the code above that line until bug #3. In this bug we want to create and show a newTitleScreen. To do that, follow these 2 instructions:// Show Title Screen below this linecreate a new instance ofTitleScreenand store it in a variable calledscreen. Your code for this step should look something like this:Screen screen = new TitleScreen();TitleScreenstored in the variablescreen, show it by callingscreen.show();. Your code for this step should look something like this:screen.show();After completing the above 2 steps
run()should look something like this:Compile and run the updated code. You should now see the title screen when the program starts:
Congratulations, you just fixed your first bug 🎉 🎈 😃!
After you have fixed this bug: