A 2D top-down adventure game written in Java. This project is a complete creation featuring crafting, exploration, combat, and survival mechanics across multiple procedurally generated levels.
- Multi-level exploration: Navigate through 5 different levels including surface, underground caves, and sky islands
- Crafting system: Create tools, furniture, and resources using workbenches, furnaces, ovens, and anvils
- Combat mechanics: Fight slimes, zombies, and the Air Wizard boss with various weapons
- Resource management: Mine ores, chop trees, farm crops, and manage stamina/health
- Furniture system: Place and interact with chests, lanterns, and crafting stations
- Procedural generation: Each world is randomly generated with different biomes and ore distributions
- 5 tool tiers: Wood, Rock, Iron, Gold, and Gem
- Tool types: Sword, Axe, Pickaxe, Shovel, and Hoe
- Power Glove: Pick up and move furniture pieces
- Basic materials: Wood, Stone, Coal, Sand, Dirt
- Ores: Iron Ore, Gold Ore, Gems
- Food: Wheat, Bread, Apples
- Special items: Slime, Glass, Cloth, Cloud essence
- Sky Level (Level 4): Floating cloud islands with cloud cacti
- Surface (Level 3): Grasslands, forests, deserts with various resources
- Cave Level 1 (Level 2): Underground with iron ore deposits
- Cave Level 2 (Level 1): Deeper caves with gold ore
- Deep Caves (Level 0): Deepest level with gem deposits and lava
- Arrow Keys / WASD: Move character
- C / Space: Attack/Use tools
- X / Enter: Open inventory/Interact with objects
- Menu Navigation: Arrow keys to select, C to confirm, X to go back
Workshop-Tales/
├── src/com/soulwax/wstales/ # Source code
│ ├── Game.java # Main game class
│ ├── InputHandler.java # Keyboard input handling
│ ├── crafting/ # Crafting recipes and system
│ ├── entity/ # Game entities (player, mobs, furniture)
│ ├── gfx/ # Graphics rendering system
│ ├── item/ # Items and tools
│ ├── level/ # Level generation and management
│ ├── screen/ # Game menus and UI
│ └── sound/ # Audio system
├── res/ # Game resources
│ ├── icons.png # Sprite sheet
│ ├── icons2.png # Additional sprites
│ └── *.wav # Sound effects
├── bin/ # Compiled output directory
└── build.xml # Ant build configuration
- Java Development Kit (JDK) 8 or higher
- Apache Ant (optional, for building)
# Compile the project
ant compile
# Create JAR file
ant jar
# Run directly
ant run
# Clean build files
ant clean# Compile source files
javac -cp src -d bin src/com/soulwax/wstales/*.java src/com/soulwax/wstales/*/*.java
# Copy resources
cp -r res/* bin/
# Run the game
java -cp bin de.soulwax.wstales.Gamejava -jar dist/Workshop\ Tales.jar- Entity-Component System: Modular entity design with inheritance
- Level Management: Multiple levels with seamless transitions
- Tile-based Rendering: 16x16 pixel tiles with sprite sheets
- Custom Graphics Engine: Software-based rendering with color palette system
- Sound System: WAV audio playback using Java Applet AudioClip
The codebase follows a well-structured OOP design with clear inheritance hierarchies and composition patterns:
Entity (abstract base)
├── Mob (movable entities with health/combat)
│ ├── Player (user-controlled character)
│ ├── AirWizard (final boss with special AI)
│ ├── Slime (jumping enemy with levels 1-4)
│ └── Zombie (walking enemy with levels 1-4)
├── Furniture (placeable interactive objects)
│ ├── Workbench (basic crafting station)
│ ├── Furnace (ore smelting)
│ ├── Oven (food preparation)
│ ├── Anvil (advanced tool crafting)
│ ├── Chest (storage container)
│ └── Lantern (light source)
├── ItemEntity (dropped items in world)
├── Spark (AirWizard projectile)
└── Particle (visual effects)
├── SmashParticle (impact effects)
└── TextParticle (floating damage numbers)
Item (interface: ListItem)
├── ToolItem (weapons and tools with 5 tiers)
├── ResourceItem (stackable materials)
├── FurnitureItem (placeable furniture)
└── PowerGloveItem (special furniture interaction tool)
Tile (abstract base for world blocks)
├── GrassTile (spreads to adjacent dirt)
├── DirtTile (diggable, can be farmed)
├── RockTile (minable with pickaxe)
├── TreeTile (choppable with axe)
├── WaterTile (swimmable liquid)
├── LavaTile (damaging liquid with light)
├── OreTile (iron/gold/gem deposits)
├── FarmTile (for growing crops)
├── WheatTile (harvestable crop)
└── StairsTile (level transitions)
Menu (abstract UI base)
├── TitleMenu (main menu)
├── InventoryMenu (item management)
├── CraftingMenu (recipe interface)
├── ContainerMenu (chest/storage)
├── DeadMenu (game over screen)
├── WonMenu (victory screen)
└── AboutMenu (credits/info)
Recipe (abstract crafting template)
├── ToolRecipe (creates tools with materials)
├── ResourceRecipe (transforms resources)
└── FurnitureRecipe (creates placeable objects)
Entity-Component Pattern: Entities have modular components like Inventory, health, collision bounds (xr, yr), and behavior methods.
Strategy Pattern: Different tile types implement unique interact(), hurt(), and tick() behaviors while sharing the base Tile interface.
Factory Pattern: LevelGen uses factory methods to create different level types (surface, underground, sky) with appropriate tile distributions.
Observer Pattern: The InputHandler observes keyboard events and notifies the game state, with key objects that track press/release states.
State Pattern: Game states are managed through the Menu system, allowing clean transitions between gameplay, inventory, crafting, and other modes.
Game.java: Main game loop, rendering, and state managementLevel.java: World generation, entity management, and tile updatesPlayer.java: Player character with inventory, crafting, and interactionLevelGen.java: Procedural world generation using noise algorithmsScreen.java: Low-level graphics rendering and sprite management
- Efficient tile-based collision detection
- Spatial partitioning for entity management
- Optimized rendering with dirty rectangle updates
- Memory-efficient sprite sheet system
- Start: Begin on the surface with basic tools
- Gather Resources: Collect wood, stone, and basic materials
- Craft Tools: Create better equipment for mining and combat
- Explore Underground: Mine ores and fight stronger enemies
- Advanced Crafting: Smelt ingots and create high-tier equipment
- Sky Islands: Access the upper level for cloud resources
- Final Boss: Defeat the Air Wizard to win the game
- Java 8 or higher: For compatibility with the game's features
- Apache Ant: For building and running the project easily
- IntelliJ IDEA or Eclipse: For a robust Java development environment
The game was developed using Eclipse.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.
"A charming little game reminiscent of classic adventure games with modern crafting mechanics, pretty cool brah" - Some guy