You escaped the Precedence Vault by predicting Java. Now you write it — for real, in VS Code, no Trinket training wheels. You'll build one program, ConsoleQuest, five levels deep: every level uses a skill from this unit, and by the end your console prints a working game screen. Future Video Game Design team: this is your first game loop's ancestor.
JavaPractice — no spaces in the name, not inside Downloads.ConsoleQuest.java — capital C, capital Q. The class name and file name must match letter for letter.main (or javac ConsoleQuest.java then java ConsoleQuest in the terminal). It must run clean BEFORE you start Level 1.
public class ConsoleQuest
{
public static void main(String[] args)
{
}
}
Red squiggles about "Unresolved compilation problem"? Check: file name matches class name exactly · no .java inside the class name · quotes are straight " not curly — retype them if you pasted.
/* */ with the game name and your name, then print a bordered title screen (at least 4 println lines). Add a // comment labeling the section. Skills: comments, println.ints (level, gold...), and 1 double (crit chance...). Print a stats block using concatenation. Skills: types, variables, concatenation..substring() on BOTH names plus something computed from .length(), built into one String variable. Skills: String methods.(strength + weaponPower) * level · turns-until-crit using % · potions you can afford using int division (gold / potionCost — the change is dropped, and that's correct). Skills: operators, precedence, modulo, int division.int lootRoll = (int)(Math.random() * 20) + 1; printed on the screen. Run the program three times — the roll must change. Skills: Math.random, casting.double cast: (double)(damage1 + damage2) / 2 · or roll damage itself: (int)(Math.random() * damage) + 1. Video Game Design team: this stats-then-compute-then-roll pattern is the skeleton of every battle system you'll ever build.Yours will have your hero and numbers — but the shape should match:
=============================
CONSOLE QUEST
a game by Jordan Mitchell
=============================
Hero: Jordan Mitchell
Level: 3 Gold: 247
Crit chance: 12.5%
Tag: JorMi14
Damage this hit: 69
Turns until crit: 0
Potions you can afford: 7
Loot roll (d20): 19
=============================
Before you screenshot: paste your whole program and hit the button. Results are grouped by level so you know exactly which one needs work.