Public
Like
TetrisGame
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.
index.ts
https://ntaboisoe--2ca64c2e319e11f085f0569c3dd06744.web.val.run
A colorful browser-based game where you play as a dog who has stolen a phone from a robot. The goal is to run away from the bot for as long as possible by hiding in an estate with buildings.
- Use the arrow keys or WASD to move the dog around the screen
- Avoid the robot that's chasing you
- Hide behind buildings in the estate to escape the bot
- The longer you survive, the higher your score
- The robot gets faster over time, making the game progressively more challenging
- Colorful estate environment with buildings and decorations
- Buildings that both you and the bot must navigate around
- Smart bot pathfinding that tries to chase you around obstacles
- Increasing difficulty as the game progresses
- Score tracking based on survival time
- Game over screen with final score and restart option
- Responsive design that works on different screen sizes
- Colorful buildings with details (houses, larger buildings, fences)
- Decorative elements like trees, flowers, and plants
- Vibrant grass background with paths
- Emoji-based characters (dog, robot, phone)
- Colorful UI elements with improved styling
- Built with HTML5 Canvas for rendering
- Pure JavaScript for game logic including obstacle avoidance and pathfinding
- CSS for styling and UI elements
- Served via a TypeScript HTTP handler in Val Town
- No external dependencies except for Twind (for styling) and error catching
The game is implemented as a TypeScript HTTP handler that serves HTML content with embedded JavaScript and CSS. This approach ensures proper content type handling and avoids parsing errors that can occur when serving HTML files directly in Val Town.
Potential enhancements that could be added:
- Power-ups that temporarily slow down the bot
- More complex estate layouts with different themes
- Sound effects and background music
- High score tracking
- Multiple levels with increasing difficulty