Episode 1: Setting Up the Java Console MOBA Game
Goal: Initialize your Java project structure, create the main entry point (`Main.java`), and display a simple welcome screen.
Episode 1: Setting Up the Java Console MOBA Game
Goal: Initialize your Java project structure, create the main entry point (Main.java
), and display a simple welcome screen.
1. Project Structure
Create the following folder layout:
1
2
3
4
5
6
7
8
9
moba-game/
── src/
├── main/
│ └── Main.java
├── model/
├── factory/
├── effect/
└── game/
2. Main.java - The Game Entry Point
Create the file: src/main/Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("=================================");
System.out.println(" Welcome to Java MOBA Console ");
System.out.println("=================================\n");
Scanner scanner = new Scanner(System.in);
System.out.println("1. Start Game");
System.out.println("2. Exit");
System.out.print("Choose option: ");
int choice = scanner.nextInt();
if (choice == 1) {
System.out.println("\nGame starting... (To be implemented in Episode 2)");
} else {
System.out.println("Goodbye!");
}
scanner.close();
}
}
This post is licensed under CC BY 4.0 by the author.