Skip to content

ac-pill/degen-invaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 DEGEN INVADERS 🚀

A degen-themed Space Invaders clone built with vanilla HTML, CSS, and JavaScript. Defend your bags from the invading bears! WAGMI!

🎮 Play the Game

Simply open index.html in your browser to start playing!

Live Demo: Play on GitHub Pages (Update with your actual URL)

🎯 How to Play

  • Move Left/Right: Arrow keys or A/D keys
  • Shoot: Spacebar
  • Pause: Click the PAUSE button

Objective

Destroy all the invading emojis (💎🚀🌙🦍) before they reach the bottom or you run out of lives!

🌟 Features

  • Classic Space Invaders gameplay with a crypto/degen theme
  • Open Game Protocol SDK integration - Connect wallet and earn OG Points!
  • Increasing difficulty with each level
  • High score tracking (stored in localStorage)
  • Responsive design
  • Retro neon aesthetic with glowing effects
  • Fun degen lingo and emojis

🎮 Open Game Protocol Integration

This game integrates the Open Game Protocol SDK to reward players with OG Points!

How It Works

  1. Just Play! - The OG Protocol SDK handles wallet connection automatically with its built-in UI
  2. Earn Points - Each enemy you destroy earns you OG Points (100 points × level)
  3. Points are Saved - When the game ends, your points are automatically saved to the OG Protocol

Setting Up Your Own Game

To use this with your own OG Protocol game:

  1. Register your game at the Open Game Protocol
  2. Get your Game ID
  3. Update in two places:
    • index.html (line 6) - Update the meta tag:
      <meta name="x-ogp-key" content="your-game-id-here">
    • game.js (line 23) - Update the SDK initialization:
      gameId: 'your-game-id-here'

SDK Methods Used

  • ogSDK.init() - Initialize the SDK with your game ID
  • ogSDK.addPoints(amount) - Award points during gameplay (SDK handles auth automatically)
  • ogSDK.savePoints(points) - Save points to the protocol when game ends

🚀 Deploying to GitHub Pages

  1. Create a new repository on GitHub

  2. Push this code to your repository:

    git init
    git add .
    git commit -m "Initial commit: DEGEN INVADERS"
    git branch -M main
    git remote add origin https://github.com/yourusername/yourrepo.git
    git push -u origin main
  3. Enable GitHub Pages:

    • Go to your repository settings
    • Navigate to "Pages" in the sidebar
    • Under "Source", select "main" branch
    • Click "Save"
    • Your game will be live at https://yourusername.github.io/yourrepo/

📁 Project Structure

game/
├── index.html    # Main HTML file
├── game.js       # Game logic and mechanics
├── styles.css    # Styling and theme
└── README.md     # This file

🎨 Customization

Change Colors

Edit the color variables in styles.css:

  • #00ff41 - Main green (player, UI)
  • #ff00ff - Magenta (tagline)
  • #ff0055 - Red (game over, enemy bullets)

Add New Invader Emojis

In game.js, find the createInvaders() function and modify:

const emojis = ['💎', '🚀', '🌙', '🦍']; // Add or change emojis here

Adjust Difficulty

In game.js, modify these variables:

let invaderSpeed = 1; // Starting speed
const enemyShootChance = 0.001; // Enemy firing frequency

🛠️ Technologies Used

  • HTML5 Canvas for rendering
  • Vanilla JavaScript for game logic
  • CSS3 for styling and animations
  • LocalStorage for high score persistence
  • Open Game Protocol SDK (@opusgamelabs/game-sdk) for Web3 integration

📝 License

Free to use and modify. Made with 💎🙌 by degens, for degens.


WAGMI! LFG! 🌙

About

Degen invaders game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published