• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
file

file

p

Public
Like
p
Home
Code
4
backend
1
frontend
1
README.md
H
index.html
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
https://file--976e40c4399211f0bf529e149126039e.web.val.run
README.md

3D Pole Vault Game

A fully functional 3D pole-vaulting game prototype built with Three.js, featuring mobile-first design and realistic physics.

🎮 Features

Core Gameplay

  • 3D Environment: Immersive 3D world with varied terrain, platforms, and decorative elements
  • Realistic Physics: Spring-damper pole mechanics with gravity and momentum
  • Mobile-First Controls: Touch-optimized interface with visual feedback
  • Camera-Driven Propulsion: Unique mechanic where camera rotation applies swing force

Controls

  • Movement Joystick (bottom-left): Walk/run around the environment
  • Vault Button (bottom-right): Hold to plant pole and swing
  • Camera Control: Touch and drag to look around and aim
  • Crosshair: Center screen targeting reticle

Pole Vaulting Mechanics

  1. Target & Plant: Aim crosshair at surfaces and hold vault button to plant pole
  2. Spring Physics: Pole behaves like a spring with realistic stretch/compression
  3. Swing Dynamics: Player orbits around pivot point with physics-based motion
  4. Camera Propulsion: Rotate camera while vaulting to apply tangential force
  5. Release: Let go of vault button to detach and fly based on momentum

🏗️ Technical Implementation

Architecture

  • Backend: Hono server serving static HTML
  • Frontend: Single HTML file with embedded Three.js game
  • Physics: Custom spring-damper system with gravity simulation
  • Controls: NippleJS for joystick, native touch events for camera

Key Components

  • PoleVaultGame Class: Main game controller
  • 3D Scene: Ground, platforms, trees with shadows and lighting
  • Player System: Capsule mesh with physics and camera following
  • Pole System: Dynamic 3D rod with spring physics and visual feedback
  • Input Handling: Touch and mouse controls for cross-platform compatibility

Performance Optimizations

  • Fixed timestep physics for consistent behavior
  • Efficient mesh updates for pole stretching
  • Mobile-optimized rendering settings
  • Responsive design for various screen sizes

🎯 How to Play

  1. Explore: Use the left joystick to move around the 3D environment
  2. Look Around: Touch and drag on screen to rotate camera and aim
  3. Plant Pole: Hold the red "VAULT" button while aiming at a surface
  4. Build Momentum: While swinging, move the camera to apply propulsive force
  5. Launch: Release the vault button at the optimal moment to fly toward distant platforms

🌟 Game Features

Environment

  • Large open world with varied terrain
  • Multiple platforms at different heights
  • Decorative trees and realistic lighting
  • Shadow mapping for visual depth

Physics

  • Realistic gravity and momentum
  • Spring-based pole mechanics with visual feedback
  • Collision detection with ground and platforms
  • Smooth camera following with interpolation

Visual Feedback

  • Pole color changes when stretched beyond rest length
  • Dynamic pole geometry showing compression/extension
  • Crosshair for precise aiming
  • Smooth animations and transitions

🚀 Getting Started

The game is ready to play immediately - just visit the backend URL and start vaulting!

Controls Summary:

  • Left joystick: Move
  • Touch/drag screen: Look around
  • Red button: Hold to vault
  • Camera movement while vaulting: Apply swing force

Try to reach all the platforms scattered around the environment using different vaulting techniques and momentum-building strategies!

HTTP
  • index.ts
    file--2b…9e.web.val.run
  • index.html
    file--97…9e.web.val.run
Code
backendfrontendREADME.md
H
index.html
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.