Copperfall is a custom 2D JavaScript/Canvas game engine and game project made for the first semester project of Creative Computing @ St. Pölten University of Applied Sciences, featuring:
- A custom game loop (
Engine.js) with scenes, game objects, and components (Inspired by Unity). - An entity-component system to easily add and remove behaviors (colliders, sprite rendering, etc.).
- A collision system for both triggers (e.g. pick-up zones) and physics-like collisions (e.g. rocks).
- Input handling that supports keyboard and gamepad, plus event-based “actions” (e.g., “dash,” “interact”).
- A flexible UI system using HTML/CSS menus, tooltips, and event-driven transitions.
- A chunk-based “world” generator that loads map data from small 8×8 pixel images, spawns GameObjects accordingly, and splices them into the main scene on demand.
.
├── assets/ # Images, audio, fonts, and screenshots
├── css/ # Stylesheets (style.css)
├── js/
│ ├── components/ # Reusable components for GameObjects
│ ├── core/ # Engine classes: Engine, GameObject, Scene, etc.
│ ├── gameobjects/ # Specific GameObject subclasses (Player, Enemies, Rock...)
│ │ └── chunks/ # Chunk-based generation logic (BaseChunk, StarterChunk, etc.)
│ ├── scenes/ # Scene definitions (MainMenuScene, MainScene, etc.)
│ └── utils/ # Helper modules (SoundManager, EasingFunctions, etc.)
├── index.html # The main HTML entry point
├── README.md # Project summary & usage instructions
└── ... (other files)
-
js/core/Engine.js- The main engine, handling:
- Game loop / requestAnimationFrame
- Loading/destroying Scenes
- Maintaining a list of active GameObjects
- Camera position & scale
- The main engine, handling:
-
js/core/GameObject.js- Base class for all objects.
- Has a
Transformand a list ofComponents.
-
js/components- Each file is a
Componentthat can be attached to aGameObject:SpriteRenderer(draws images)BoxCollider,CircleCollider, etc.Rigidbody(simple physics flags)ScreenShake,SquashAndStretch, etc.
- Each file is a
-
js/gameobjects- Prebuilt specialized
GameObjects (e.g.Player.js,Rock.js,Spaceship.js,EnemyFast.js, etc.). InputHandler.js: Singleton that polls keyboard and gamepad, emits action events.UIManager.js&ToolTipManager.js: Show/hide UI overlays (menus, tooltips).ChunkManager.js&chunks/: Generates the world in “chunks” and loads objects from small PNG map “blueprints.”
- Prebuilt specialized
-
js/scenes- Scenes like
MainMenuSceneorMainScenedefine which objects get created, their arrangement, etc.
- Scenes like
-
js/utilsSoundManager.jswithSoundEffects.jsfor playing audio clips.EasingFunctions.js: standard easing formulas for animations.Actions.js: enumerates game-wide action names (e.g.DASH,INTERACT).
- Open
index.htmlin a browser (serve via an HTTP server) to run locally. - No special build steps are required; the
.jsfiles are ES modules imported inmain.js.
(Use a local dev server, browsers typically disable some js features for security reasons otherwise.)




