Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Java Time Loop Explorer

A console-based Java exploration game built around a time-loop concept. The project demonstrates custom linked data structures, circular turn management, random event processing, inventory management, action logging, and branching timelines.

Players take turns exploring rooms, encountering random events, collecting special stones, and attempting to break the time loop by using Echo Stones in the correct sequence.

Features

  • Multiplayer turn-based exploration
  • Circular turn management between explorers
  • Reversible turn direction
  • Random events affecting health, treasure, inventory, and turn order
  • Echo Stone collection and usage
  • Paradox Stones for viewing or creating timelines
  • Branching timeline system
  • Player health and treasure tracking
  • Custom linked-list inventory
  • Action history logging
  • Win and elimination conditions
  • Console-based interactive interface

Project Structure

java-time-loop-explorer/
├── src/
│   ├── ActionLog.java
│   ├── Event.java
│   ├── Explorer.java
│   ├── Game.java
│   ├── Inventory.java
│   ├── TestGame.java
│   ├── TimeLine.java
│   └── Turn.java
├── .gitignore
└── README.md

Main Components

Game

Controls the main game state and gameplay logic, including:

  • Moving explorers between rooms
  • Triggering random events
  • Using Echo Stones
  • Using Paradox Stones
  • Creating timeline branches
  • Checking win and loss conditions
  • Managing turns

Explorer

Represents each player in the game.

Each explorer has:

  • A name
  • Health points (HP)
  • Treasure count
  • An inventory
  • References to the next and previous explorer

Explorers begin with 3 HP and no treasure.

Turn

Manages the explorer turn order using a circular doubly linked structure.

It supports:

  • Adding explorers
  • Moving to the next explorer
  • Reversing turn direction
  • Removing eliminated explorers
  • Maintaining circular traversal

Event

Generates random events during exploration.

Possible effects include:

  • Losing HP
  • Gaining HP
  • Finding treasure
  • Finding an Echo Stone
  • Finding a Paradox Stone
  • Reversing the turn order

Inventory

Stores the stones collected by each explorer using a linked structure.

Two special stone types are available:

  • Echo Stone — numbered stones used to break the time loop
  • Paradox Stone — allows interaction with the timeline system

TimeLine

Manages alternative timeline branches.

The game begins with a main timeline. Players with a Paradox Stone can create additional branches and view existing timelines.

ActionLog

Maintains a linked history of player actions within a timeline.

Logged actions include:

  • Movement
  • Echo Stone usage
  • Paradox Stone usage

TestGame

Contains the main method and provides the console-based interface for playing the game.

Data Structures & Concepts

This project demonstrates several programming and data structure concepts:

  • Object-Oriented Programming
  • Singly Linked Lists
  • Doubly Linked Structures
  • Circular Linked Structures
  • Dynamic turn management
  • Random event generation
  • Branching structures
  • Action logging
  • Inventory management
  • State-based game logic

Game Rules

Each explorer begins with:

HP: 3
Treasure: 0
Inventory: Empty

During a turn, the player can:

1) Move
2) Use Echo
3) View Timelines
4) Forge New Path

Moving triggers a random event.

Events may damage or heal the explorer, award treasure, provide special stones, or reverse the direction of the turn order.

Echo Stones

Echo Stones are numbered:

1
2
3

To break the time loop, an explorer must successfully use the Echo Stones in the required sequence:

1 → 2 → 3

Completing the sequence satisfies the game's win condition.

Paradox Stones

Paradox Stones interact with the timeline system.

A Paradox Stone can be used to:

  • View existing timelines
  • Forge a new timeline branch

Each branch maintains its own action log.

How to Run

Requirements

  • Java Development Kit (JDK)

Compile

From the repository root:

javac src/*.java

Run

java -cp src TestGame

Example Gameplay

#### ==== The Time Loop Explorers ==== ####

Explorer name: Alice
Explorer name: Bob

Game start! Use Echo Stones 1 -> 2 -> 3.

Turn: Alice | HP=3 | T=0

1) Move
2) Use Echo
3) View Timelines
4) Forge New Path

Choice:

Purpose

This project was developed as an academic Java project to practice data structures and object-oriented programming through an interactive game simulation.

The implementation focuses on linked structures, circular traversal, dynamic turn management, event processing, inventory operations, and timeline branching.

Author

Zeynep Oktay

About

A Java-based turn-driven exploration game demonstrating linked lists, stacks, circular data structures, and random event processing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages