jhnoor / asteroids

MIT License
0 stars 0 forks source link

Make an asteroids game #2

Open jhnoor opened 1 year ago

jhnoor commented 1 year ago

Asteroids Game Repository

This repository contains the source code for a simple asteroids game written in JavaScript/TypeScript. The game features a ship that spawns in the middle of the screen, which can be controlled using the arrow keys to steer and propel. The game has a black background, white asteroids, and the ship is represented as an arrow.

Table of Contents

Getting Started

These instructions will help you set up the project on your local machine for development and testing purposes.

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/asteroids-game.git
  1. Change to the project directory:
cd asteroids-game
  1. Install the dependencies:
npm install

Running the Game

To run the game locally, execute the following command:

npm start

This will open the game in your default web browser.

Controls

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

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

tarik-tasktopr commented 1 year ago

Step-by-step discussion

We will create an asteroids game using JavaScript/TypeScript. The game will feature a ship that spawns in the middle of the screen, which can be controlled using the arrow keys to steer and propel. The game will have a black background, white asteroids, and the ship will be represented as an arrow. We will also set up the project with Node.js, NPM, and provide instructions for installation, running the game, controls, contributing, and licensing.

Plan

  1. Create and populate the file README.md | This file will contain the description, table of contents, getting started, prerequisites, installation, running the game, controls, contributing, and license sections.
  2. Create and populate the file .gitignore | This file will list the files and folders that should not be tracked by Git, such as node_modules and other temporary files.
  3. Create and populate the file package.json | This file will contain the project's metadata, dependencies, and scripts for running the game.
  4. Create and populate the file tsconfig.json | This file will contain the TypeScript configuration for the project.
  5. Create and populate the file src/index.html | This file will be the main HTML file for the game, containing the canvas element and linking to the compiled JavaScript file.
  6. Create and populate the file src/index.ts | This file will be the main TypeScript file for the game, containing the game logic, event listeners, and rendering.
  7. Create and populate the file src/ship.ts | This file will contain the Ship class, which will handle the ship's movement, rotation, and shooting.
  8. Create and populate the file src/asteroid.ts | This file will contain the Asteroid class, which will handle the asteroid's movement and collision detection.
  9. Create and populate the file src/collision.ts | This file will contain the collision detection functions for the game.
  10. Create and populate the file src/utils.ts | This file will contain utility functions for the game, such as random number generation and distance calculation.
  11. Create and populate the file CONTRIBUTING.md | This file will contain the guidelines for contributing to the project.
  12. Create and populate the file LICENSE.md | This file will contain the MIT License for the project.

    EDIT: Plan approved! ✅

tarik-tasktopr commented 1 year ago

Step-by-step discussion

First, we need to create the necessary files and directories for the project. We will need an index.html file to display the game, a main.js file for the game logic, and a style.css file for styling. Additionally, we will need a package.json file to manage dependencies and scripts, and a .gitignore file to exclude unnecessary files from the repository. We will also create a README.md file to provide information about the project and a LICENSE.md file to specify the license.

Plan

  1. Create and populate the file index.html | This file will be the main entry point for the game and will display the game canvas.
  2. Create and populate the file main.js | This file will contain the game logic, including the ship, asteroids, and controls.
  3. Create and populate the file style.css | This file will contain the styling for the game, such as the black background and white asteroids.
  4. Create and populate the file package.json | This file will manage the project's dependencies and scripts, such as running the game locally.
  5. Create and populate the file .gitignore | This file will exclude unnecessary files, such as node_modules, from the repository.
  6. Create and populate the file README.md | This file will provide information about the project, including how to set up and run the game.
  7. Create and populate the file LICENSE.md | This file will specify the MIT License for the project.
  8. Create and populate the file CONTRIBUTING.md | This file will provide guidelines for contributing to the project, such as the code of conduct and the process for submitting pull requests.

    EDIT: Plan approved! ✅