Skip to content

First Development Build

Pre-release
Pre-release

Choose a tag to compare

@psychoStark psychoStark released this 30 May 15:35
· 8 commits to main since this release
1a51dfd

v0.0.0-dev: Initial Engine & Core Systems

Welcome to the first developmental build of Critical Charge! ⚡

This initial pre-release establishes the core Vanilla JS game engine, hardware sensor integrations, and foundational architecture. The game is fully playable from start to crash, featuring dynamic physics tied to the device's real-world battery percentage.

🚀 Core Gameplay & Physics

  • Battery-Driven Engine: Integrated the navigator.getBattery() API. The game reads the device's real battery level to dynamically scale track speed and player gravity.
  • Responsive Controls: Implemented a unified input system supporting Keyboard (Desktop), Swipe gestures (Mobile), and Gyroscope tilt controls.
  • Procedural Track: Infinite scrolling neon track with perspective-scaled rendering and dynamic obstacle pooling.
  • Speed Trails Effect: Hyper-speed visual warp lines that activate when battery drops below critical thresholds.

🎵 Dynamic Audio & 📳 Haptics

  • Multi-Tiered BGM: Background music automatically lazy-loads and swaps to more intense tracks as the battery drains.
  • Dynamic Pitch Scaling: Jump sound effects dynamically shift in pitch based on the player's battery weight (deep sounds at 100%, airy sounds at 10%).
  • Hardware Haptics: Integrated navigator.vibrate for tactile feedback on UI taps, jumps, landings, lane changes, and heavy crash impacts.
  • Persistent Settings: Audio mute state and control preferences are saved globally via localStorage.

🦠 W.I.R.U.S. Anti-Cheat Protocol

  • Charger Intercept: Implemented a system to prevent infinite play while plugged into a wall outlet.
  • Hijacked State (Level 1): Plugging in triggers warning sirens, blinks the screen, pulses hardware haptics, and pauses the game until unplugged.
  • Corrupted State (Level 2): Rapidly toggling the charger triggers a catastrophic failure, locking the game in a blackout state and wiping all local save data.

🧪 Developer Test Lab

  • Sandbox Environment: Added a dedicated /test.html environment (accessible globally via the ` key) for hardware-free debugging.
  • Mock Battery API: Developers can simulate battery drain, toggle charger states, and reset power via keyboard or mobile touch shortcuts.
  • Visual Debugger: Real-time HUD displaying engine FPS, active audio tracks, active haptic pulses, and raw input coordinate data.

💾 State Management

  • Robust Save/Load: Players can manually save their exact position, score, and the exact coordinates of all rendered obstacles to seamlessly resume later.
  • Unified UI Overlays: Dynamic, cyberpunk-themed canvas overlays for Pause, Game Over, and Hardware Unsupported states.

🛠️ Architecture & Tech Stack

  • Vite Bundler: Optimized build pipeline using Vite with a public/assets/ strategy for clean ES6 imports and fast bundling.
  • Vanilla JS Engine: Zero external game frameworks. Custom requestAnimationFrame loop decoupled from UI rendering to prevent crash locks during error states.
  • Optimized Rendering: Eliminated per-frame Math.random() and trigonometric calculations using pre-computed angle pools and road-step lookup tables.

💻 How to Run Locally

1. Web Version (HTML5 / Browser)

  • Download the build.
  • Run npx vite preview --open to start a local server and play.

2. Android Version (APK)

  • Download the .apk file to your Android phone and install it.
  • Play Protect Warning: Because this game is distributed via GitHub and not the Google Play Store, Android will display a security warning. Simply Tap "Scan app", if it didn't work open the .apk again and tap "More details" and select "Install anyway" this time.

Note: Gameplay requires a Chromium-based browser (Chrome, Edge, Opera) to access the Battery Status API. iOS Safari and Firefox will display an unsupported hardware screen.




Pull History

Full Changelog: https://github.com/psychoStark/critical-charge/commits/0.0.0-dev