Skip to content

bwescott/HelloCodeSchoolProject

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗡️ Zelda Adventure - Mobile Game

A Zelda-inspired adventure game designed for mobile devices and web browsers. Explore a vibrant world, battle enemies, collect treasures, and embark on an epic adventure!

🎮 Game Features

  • Cross-Platform: Runs on mobile devices and desktop browsers
  • Touch Controls: Intuitive virtual joystick and action buttons for mobile
  • Keyboard Support: WASD/Arrow keys + Space/X for desktop play
  • Adventure Gameplay: Classic top-down Zelda-style action adventure
  • Combat System: Sword attacks and magical sword beams
  • Enemy AI: Smart enemies with patrol, chase, and attack behaviors
  • Collectibles: Coins and power-ups scattered throughout the world
  • Procedural World: Varied terrain with grass, water, forests, and stone areas
  • Health System: Classic heart-based health system
  • Particle Effects: Visual feedback for attacks and interactions

🎯 How to Play

Goals

  • Explore the world and defeat enemies
  • Collect golden coins for points
  • Survive as long as possible with your 3 hearts

Controls

Mobile/Touch:

  • 📱 Virtual joystick (left side) to move your character
  • ⚔️ Sword button (right side) to attack enemies
  • 💫 At full health, attacks shoot magical sword beams!

Desktop/Keyboard:

  • 🎮 WASD or Arrow Keys to move
  • ⚔️ SPACE or X to attack
  • 💫 Sword beams at full health!

Gameplay Tips

  • ❤️ You start with 3 hearts of health
  • 👹 Green goblins are basic enemies - defeat them for 100 points each
  • 💰 Golden coins give you 10 points and bob up and down
  • 🌊 Avoid water tiles - you can't swim!
  • 🌲 Trees and rocks block your movement
  • 💫 Sword beams only work when you're at full health
  • 🛡️ After taking damage, you're briefly invulnerable (flickering effect)

🚀 Getting Started

Quick Start

  1. Open index.html in a web browser
  2. The game will auto-detect if you're on mobile or desktop
  3. Follow the on-screen instructions
  4. Start your adventure!

Local Development

  1. Clone this repository
  2. Install dependencies: npm install
  3. Start local server: npm start
  4. Open http://localhost:8080

Building for Production

npm run build

🏗️ Project Structure

zelda-mobile-game/
├── index.html          # Main HTML file with game canvas
├── package.json        # Dependencies and scripts
├── js/
│   ├── main.js         # Game initialization and UI
│   ├── game.js         # Core game engine and loop
│   ├── player.js       # Player character and combat
│   ├── enemy.js        # Enemy AI and behavior
│   ├── world.js        # World generation and rendering
│   └── controls.js     # Input handling (touch + keyboard)
├── assets/
│   ├── images/         # Game sprites (placeholder)
│   └── sounds/         # Game audio (placeholder)
└── test/               # Unit tests

🎨 Technical Features

  • HTML5 Canvas: High-performance 2D rendering
  • Responsive Design: Adapts to different screen sizes
  • Touch Events: Multi-touch support for mobile devices
  • Game Loop: Smooth 60fps animation with delta timing
  • State Management: Pause/resume functionality
  • Camera System: Smooth camera following the player
  • Collision Detection: Efficient rectangle-based collision system
  • Particle System: Visual effects for impacts and collectibles
  • Device Detection: Automatic mobile/desktop optimization

🎵 Browser Support

  • Modern Browsers: Chrome, Firefox, Safari, Edge
  • Mobile: iOS Safari, Chrome Mobile, Samsung Browser
  • Features Used: ES6 Classes, Canvas 2D, Touch Events, RequestAnimationFrame

🔧 Development

Adding New Features

  • New Enemies: Extend the Enemy class with different types
  • Power-ups: Add new collectible types to the world generation
  • Weapons: Create new projectile types and attack patterns
  • Levels: Implement level transitions and multiple worlds
  • Audio: Add sound effects and background music

Performance Tips

  • The game automatically pauses when the tab is hidden
  • Canvas rendering is optimized for mobile devices
  • Only visible objects are rendered (camera culling)
  • Particle systems have automatic cleanup

📱 Mobile Optimization

  • Responsive canvas scaling
  • Touch controls with visual feedback
  • Optimized for portrait and landscape modes
  • PWA-ready (can be added to home screen)
  • Efficient rendering for battery life

🐛 Known Issues

  • Water collision could be more precise
  • Enemy pathfinding is basic (room for AI improvements)
  • No save/load system yet
  • Limited audio support

📄 License

MIT License - Feel free to use this code for learning or building your own games!

🤝 Contributing

This is a learning project, but contributions are welcome! Ideas for improvements:

  • Add more enemy types and behaviors
  • Implement a level/dungeon system
  • Add more weapons and items
  • Create sprite-based graphics
  • Add sound effects and music
  • Implement game save/load
  • Add multiplayer support

Have fun exploring and may your adventure be legendary! ⚔️✨

About

Demonstration on how projects work at Code School.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.1%
  • HTML 8.9%