Skip to content

jpvelasco/cosmic-assault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmic Assault - Space Shooter Game

A fast-paced space shooter game built with HTML5 Canvas, JavaScript, and modern web technologies. Play as a space pilot defending against waves of asteroids while collecting powerups and achieving high scores.

Features

  • 🚀 Smooth 2D space shooter gameplay
  • 🎮 Responsive controls for both desktop and mobile
  • 🌟 Powerups including Shield, Double Shot, Rapid Fire, and Field Bomb
  • 💥 Dynamic particle effects and screen shake
  • 🎵 Sound effects and background music
  • 🏆 High score tracking
  • 🌠 Bonus rounds and meteor showers
  • 📱 Mobile-friendly interface with virtual joystick
  • 🎮 Fullscreen support for better immersion

Getting Started

Prerequisites

  • Modern web browser (Chrome, Firefox, Safari recommended)
  • Node.js (LTS version recommended)
  • npm (comes with Node.js)
  • AWS CLI (configured with appropriate permissions)
  • AWS Account

Setup and Deployment

These steps cover cloning the repository, installing dependencies, building the infrastructure code, and deploying the stack to AWS.

  1. Clone the repository:

    git clone https://github.com/jpvelasco/cosmic-assault
    cd cosmic-assault
  2. Navigate to Infrastructure Directory:

    cd infrastructure
  3. Install Dependencies: Install the required Node.js packages for the CDK project.

    npm install
  4. Build Infrastructure Code: Compile the TypeScript code into JavaScript. This is necessary before running any CDK commands.

    npm run build
  5. (Optional) Configure AWS Credentials: Ensure your AWS CLI is configured with the necessary permissions if you haven't already.

    aws configure
  6. Deploy to AWS: Deploy the infrastructure stack (S3 bucket, CloudFront distribution) and the website content.

    cdk deploy

    Note: You might be prompted to approve IAM policy changes during the first deployment. After deployment, the CloudFront distribution URL will be displayed as an output.

This deployment process will:

  • Create the necessary AWS infrastructure (S3 bucket, CloudFront distribution, etc.).
  • Upload the static website files from the ../website directory to the S3 bucket.
  • Configure the CloudFront distribution to serve the website.

Game Controls

Desktop

  • Arrow keys: Move/rotate ship
  • Spacebar: Shoot
  • F: Toggle fullscreen
  • M: Toggle sound
  • R: Restart game (when game over)

Mobile

  • Virtual joystick: Move ship
  • Fire button: Shoot
  • Restart button: Restart game (when game over)

Game Mechanics

  • Destroy asteroids to earn points
  • Collect powerups to enhance your ship
  • Avoid collisions with asteroids and danger zones
  • Survive bonus rounds and meteor showers
  • Aim for the highest score!

Project Structure

cosmic-assault/
├── website/             # Static website files (HTML, CSS, JS)
│   ├── index.html
│   ├── style.css
│   ├── game-modular.js  # Entry point
│   └── modules/         # ES6 module architecture (core, entities, systems, utils)
└── infrastructure/      # AWS CDK infrastructure code (TypeScript)
    ├── package.json
    ├── tsconfig.json
    ├── cdk.json         # CDK configuration
    ├── bin/             # CDK entry point script
    ├── lib/             # CDK stack definitions
    └── dist/            # Compiled JavaScript output (generated by `npm run build`)

Development Tools

Website/Game

  • HTML5 Canvas
  • JavaScript (ES6+)
  • CSS3

Infrastructure

  • AWS CDK for Infrastructure as Code (IaC)
  • TypeScript for defining infrastructure resources
  • AWS CloudFormation (used by CDK for deployment)
  • Jest for testing infrastructure code (if applicable)

Contributing

  1. Fork the repository (https://github.com/jpvelasco/cosmic-assault)
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Useful CDK Commands (Run from infrastructure directory)

# Synthesize CloudFormation template
cdk synth

# Compare local changes with deployed stack
cdk diff

# Deploy changes to AWS
cdk deploy

# Destroy the deployed infrastructure
cdk destroy

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to all contributors and testers
  • Special thanks to the open-source community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors