Chevy is a 2D game based on Java Swing.
You can download the latest release from this link. To run the game double-click on the jar file. You need to have Java 21 or later installed on your system.
Some useful life-cycle phases:
mvn clean
removestarget/
after the buildmvn compile
compiles the projectmvn exec:exec
runs the project after compilationmvn package
produces thejar
archive also containing the dependencies
The phases can be chained, e.g. mvn clean compile
removes target/
and recompiles the project from scratch.
Tip
Running only mvn
compiles and runs the app in one go.
The app can be installed on the Linux desktop (tested in Gnome) with the command mvn install
. This will copy some files under the directory
~/.local
. To uninstall the app and remove these files use the command mvn clean -P uninstall
. Game saves will not be removed.
The main menu uses a monochromatic palette based on purple (HSB(280, 80, 60)
). Interface elements that are meant to stand out use nearby colors, blue and pink.
---
Title: Entity Hierarchy
---
classDiagram
Entity <|-- DynamicEntity
Entity <|-- Collectable
Entity <|-- Environment
Environment <|-- Barrier
Environment <|-- Chest
Environment <|-- Ground
Environment <|-- Wall
Environment <|-- Stair
Environment <|-- Trap
Trap <|-- IcyFloor
Trap <|-- Sludge
Trap <|-- SpikedFloor
Trap <|-- Totem
Trap <|-- Trapdoor
Trap <|-- Void
Collectable <|-- Coin
Collectable <|-- Health
Collectable <|-- Key
Collectable <|-- PowerUp
PowerUp <|-- Agility
PowerUp <|-- AngelRing
PowerUp <|-- BrokenArrows
PowerUp <|-- CoinOfGreed
PowerUp <|-- ColdHearth
PowerUp <|-- GoldArrow
PowerUp <|-- HealingFlood
PowerUp <|-- HedgehogSpines
PowerUp <|-- HobnailBoots
PowerUp <|-- HolyShield
PowerUp <|-- HotHeart
PowerUp <|-- KeySKeeper
PowerUp <|-- LongSword
PowerUp <|-- PieceOfBone
PowerUp <|-- SlimePiece
PowerUp <|-- StoneBoots
PowerUp <|-- VampireFangs
DynamicEntity <|-- LiveEntity
DynamicEntity <|-- Projectile
LiveEntity <|-- Enemy
LiveEntity <|-- Player
Enemy <|-- Beetle
Enemy <|-- BigSlime
Enemy <|-- Skeleton
Enemy <|-- Slime
Enemy <|-- Wraith
Enemy <|-- Zombie
Player <|-- Knight
Player <|-- Archer
Player <|-- Ninja
Projectile <|-- Arrow
Projectile <|-- SlimeShot
Every Entity
in the game is in a state at any given time. The StateMachine
, which is nothing but a finite state machine, manages the definition of states and edges that regulate the transition between them.
---
title: Player States
---
stateDiagram-v2
[*] --> IDLE
IDLE --> MOVE
IDLE --> ATTACK
IDLE --> HIT
IDLE --> FALL
HIT --> IDLE
HIT --> DEAD
HIT --> MOVE
HIT --> FALL
MOVE --> GLIDE
MOVE --> HIT
MOVE --> FALL
MOVE --> SLUDGE
MOVE --> IDLE
MOVE --> ATTACK
ATTACK --> IDLE
ATTACK --> MOVE
ATTACK --> HIT
GLIDE --> IDLE
GLIDE --> FALL
GLIDE --> HIT
GLIDE --> SLUDGE
SLUDGE --> IDLE
FALL --> IDLE
FALL --> DEAD
DEAD --> [*]
---
title: Enemy States
---
stateDiagram-v2
[*] --> IDLE
IDLE --> MOVE
IDLE --> ATTACK
IDLE --> HIT
MOVE --> IDLE
MOVE --> HIT
ATTACK --> IDLE
ATTACK --> HIT
HIT --> IDLE
HIT --> DEAD
DEAD --> [*]
---
title: Collectable States
---
stateDiagram-v2
[*] --> IDLE
IDLE --> COLLECTED
COLLECTED --> [*]
- The ninja sprite is a modified version of Superpowers Asset Packs (CC0)
- The look & feel for swing is FlatLaf (Apache-2.0)
- The audio resources are all royalty free and come from
- Interface font: VT323
- The character quotes on the main menu and the death dialog messages are generated by ChatGPT
- Various resources come from opengameart.org, the files are accompanied by the respective licenses.
- Some icons come from flaticon.com