game with java #73447
Replies: 2 comments 3 replies
-
What exactly do you need help with? Your code has other class but in your main class You forgot to open a new import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Once upon a time, there was a girl and her dad.");
System.out.println("You are the girl, and you need to make choices to progress in the story");
System.out.println("Let's begin");
scanner.close();
}
}
public class House {
private string location;
private boolean isDark;
public House(String location) {
this.location = location;
this.isDark = true;
}
public String getLocation() {
return location;
}
public boolean isDark() {
return isDark;
}
public void enter() {}
}
public class Ghost {
private String name;
private int scareLevel;
public Ghost(String name, int scareLevel) {
this.name = name;
this.scareLevel = scareLevel;
}
public String getName() {
return name;
}
public int getScareLevel() {
return scareLevel;
}
public void haunt() {
}
public class EnormousSpider {
private String name;
private int numberOfLegs;
public EnormousSpider(String name, int numberOfLegs) {
this.name = name;
this.numberOfLegs = numberOfLegs;
}
public String getName() {
return name;
}
public int getNumberOfLegs() {
return numberOfLegs;
}
public void craw() {}
public class Zombie {
private String name;
private int health;
public Zombie(String name, int health) {
this.name = name;
this.health = health;
}
public String getName() {
return name
}
public int getHealth() {
return health;
}
public void attac() {}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
import java.util.Scanner;
public class App
public static void main (String[]args)
{Scanner scanner = new Scanner(System.in);
System.out.println("Once upon a time, there was a girl and her dad.");
System.out.println("You are the girl, and you need to make choices to progress in the story");
System.out.println("Let's begin");
scanner.close();
}
}
public class House{
private string location;
private boolean isDark;
public House(String location) {
this.location = location;
this.isDark = true;
}
public String getLocation() {
return location;
}
public boolean isDark() {
return isDark;
}
public void enter() {
}
}
public class Ghost{
private String name;
private int scareLevel;
public Ghost(String name, int scareLevel) {
this.name = name;
this.scareLevel = scareLevel;
}
public String getName() {
return name;
}
public int getScareLevel() {
return scareLevel;
}
public void haunt() {
}
}
}
}
HELP ME!
Beta Was this translation helpful? Give feedback.
All reactions