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.
- 🚀 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
- 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
These steps cover cloning the repository, installing dependencies, building the infrastructure code, and deploying the stack to AWS.
-
Clone the repository:
git clone https://github.com/jpvelasco/cosmic-assault cd cosmic-assault -
Navigate to Infrastructure Directory:
cd infrastructure -
Install Dependencies: Install the required Node.js packages for the CDK project.
npm install
-
Build Infrastructure Code: Compile the TypeScript code into JavaScript. This is necessary before running any CDK commands.
npm run build
-
(Optional) Configure AWS Credentials: Ensure your AWS CLI is configured with the necessary permissions if you haven't already.
aws configure
-
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
../websitedirectory to the S3 bucket. - Configure the CloudFront distribution to serve the website.
- Arrow keys: Move/rotate ship
- Spacebar: Shoot
- F: Toggle fullscreen
- M: Toggle sound
- R: Restart game (when game over)
- Virtual joystick: Move ship
- Fire button: Shoot
- Restart button: Restart game (when game over)
- 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!
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`)
- HTML5 Canvas
- JavaScript (ES6+)
- CSS3
- 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)
- Fork the repository (https://github.com/jpvelasco/cosmic-assault)
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Synthesize CloudFormation template
cdk synth
# Compare local changes with deployed stack
cdk diff
# Deploy changes to AWS
cdk deploy
# Destroy the deployed infrastructure
cdk destroyThis project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors and testers
- Special thanks to the open-source community