Skip to content

JCTRoth/Castle_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CastleGame

Java clone of "Battle for Wesnoth"

CastleGame is a turn-based strategy game developed in Java, inspired by the classic "Battle for Wesnoth." It features tactical combat with various unit types, each having unique movement, attack, and defense capabilities. Players navigate a randomly generated battlefield with fog of war, line-of-sight mechanics, and resource management through gold-based purchasing.

Requirements

  • Java 21
  • Gradle

Building and Running

To build and run the game:

./gradlew build
./gradlew run

Units can move a certain amount of steps. There are different type of units where each has its own attack and defense level. The player can only see enemy units if it's in line of sight. The game features are: a randomly generated game field, fog of war and a battle system.

Its simple to create new games with this code due to the strong "GameController" and the "GUIController" classes.

CastleGame_img1 CastleGame_img2

CastleGame_img2

CastleGame_img3

CastleGame_img4

An Attack was Commited:

CastleGame_img5

Project Structure and Patterns

This game is built in Java using a simple structure to keep things organized.

Main Parts:

  • Logic: Handles the game rules, like moving units, fighting, and keeping track of players. (Files in src/logic/)
  • GUI: Manages the graphics and user interface, like the game board and menus. (Files in src/gui/)
  • Controller: Connects the logic and GUI, making sure they work together. (Files in src/controll/)

Design Ideas Used:

  • MVC Pattern: Separates the game data (Model), what you see (View), and how they interact (Controller).
  • Observer Pattern: The game logic tells the controllers when something happens, like a unit moving.
  • Strategy Pattern: Different units (like knights or archers) have their own ways of behaving.

This setup makes it easy to add new features or change how the game looks without breaking other parts.

About

Java clone of "Battle for Wesnoth"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages