DEV Community

Cover image for "Floating on Code: Building an Anti-Gravity AI Agent for Hacktoberfest"
Archit Gaware
Archit Gaware

Posted on Edited on

"Floating on Code: Building an Anti-Gravity AI Agent for Hacktoberfest"

๐Ÿ‘ป Anti-Gravity AI: Ghost in the Machine

๐Ÿ† Official Entry for the Hacktoberfest Open-Source AI Challenge

demo : - https://babatheslayer.github.io/HACKTOBER-FEST/

"In the void between clock cycles, mass is an illusion, friction is zero, and momentum is immortal."


๐ŸŒŒ Overview

Anti-Gravity AI: Ghost in the Machine is a 2D zero-gravity physics simulator and ambient AI playground assembled entirely inside a single, zero-dependency index.html file.

Set in an abandoned deep-space mainframe where gravity has been switched off ($G = 0.0$), users interact with an autonomous, spectral AI astronautโ€”"The Zero-G Ghost"โ€”who drifts eternally through the vacuum, commenting on decaying bytecodes and answering cosmic inquiries.

๐Ÿ•น๏ธ Live Demo / Quick Run

No build steps, Node.js installations, or API keys needed!

  1. Double-click index.html in any modern web browser (Chrome, Edge, Firefox, Brave, Safari).
  2. Or serve locally with any static server:
   npx serve .
   # or
   python -m http.server 8000
Enter fullscreen mode Exit fullscreen mode

โœจ Key Features

๐Ÿš€ 1. Frictionless Zero-G Physics Engine (HTML5 Canvas)

  • Conservation of Momentum: Without friction or atmosphere, spawned objects maintain linear and angular momentum indefinitely.
  • 2D Elastic Vector Collisions: Rigorous momentum & impulse exchange upon collision between matter.
  • Interactive Spawn Palette:
    • ๐Ÿš€ Space Debris: Asteroid fragments, busted satellite solar panels, and scrap iron.
    • ๐Ÿ’พ Abandoned Code Packets: Glitching ROM cartridges and RAM blocks stamped with real runtime errors (0xDEADBEEF, Segmentation fault (core dumped), undefined is not a function).
    • ๐Ÿ”ฎ Haunted Nodes: Pulsating ethereal energy cores that cast glowing quantum filament tethers to nearby nodes and exhibit harmonic resonance.
    • ๐Ÿ•ณ๏ธ Quantum Singularities: Micro black holes exerting inverse-square gravitational pull on all surrounding matter.

๐Ÿ‘ป 2. The Spectral Astronaut / "Ghost in the Machine"

  • Procedural canvas creature with animated sine-wave bobbing, interactive cursor eye-tracking, glowing cybernetic visor, and ectoplasmic particle exhaust.
  • Dynamic floating speech bubbles that react to user events and environment changes.
  • "Disturb the Ghost" Button / Shockwave Blast: Rattles the ghost's containment field, triggering a high-velocity radial blast that scatters all matter across the screen with camera shake and audio glitching!

๐Ÿง  3. In-Browser Client-Side AI (Transformers.js / Hugging Face)

  • Powered by @xenova/transformers running ONNX weights directly in WebAssembly/WebGL memory.
  • Zero API keys, zero rate limits, and 100% privacy-preserving: Runs locally on the client's machine.
  • Dual Neural Pipeline: Features an instant Spectral Quantum Heuristic generator while the Transformers.js neural weights load, ensuring zero freeze or loading delay.
  • Autonomous Observations: The ghost periodically inspects the floating debris and code packets, speaking poetic commentary.

๐ŸŽต 4. Procedural Web Audio Synthesizer

  • Zero external audio files: Synthesizes low-frequency 55Hz space drone, metallic bounce impacts, ethereal harmonic chords, cyber chirps, and sub-bass shockwaves directly through the browser AudioContext.

๐ŸŽ›๏ธ Controls & UI Guide

Control Description
Click & Drag Set ejection vector and velocity to launch objects into 0-G space.
Click Ghost Resonate directly with the ghost entity to disturb its float state.
Double Click Trigger a localized vacuum impulse shockwave.
TOGGLE GRAVITY Switch between pure $0.0G$ frictionless float, downward gravity pull, and reverse glitch float.
DISTURB GHOST Triggers an emergency ectoplasmic detonation flinging all matter outward.
Matter Palette Select between Space Debris, Code Packets, Haunted Nodes, and Singularities.
CRT Toggle Switch retro phosphor scanlines and vignette on or off.
DEV Submission Info Opens submission overview with one-click copyable DEV.to challenge report.

๐Ÿ› ๏ธ Tech Stack

  • Physics & Graphics: Pure Vanilla HTML5 Canvas 2D API
  • Styling: Tailwind CSS (via CDN) + Cyberpunk Scanline CSS
  • Machine Learning: Hugging Face Transformers.js
  • Audio: Native Web Audio API (OscillatorNode, BiquadFilterNode, GainNode)
  • Typography: Orbitron & Share Tech Mono (Google Fonts)

๐Ÿ“ DEV.to Hacktoberfest Submission Template

To submit to the Hacktoberfest Open-Source AI Challenge on DEV:

  1. Open the app and click ๐Ÿ† SUBMISSION INFO in the top navigation bar.
  2. Click ๐Ÿ“‹ Copy DEV Post Template.
  3. Paste directly into your draft at dev.to/new under the #hacktoberfest tag!

Crafted with ๐Ÿ’œ for the Hacktoberfest Open-Source Community.

Top comments (0)