Skip to content

hojun313/glatic_shooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glatic Shooter

A simple 2D space shooter game built with HTML5 Canvas and JavaScript.

How to Play

  1. Clone or download this repository.
  2. Open the index.html file in your web browser.
  3. Use the arrow keys to move your spaceship.
  4. Press the spacebar to shoot bullets.
  5. Avoid enemy bullets and destroy enemy ships to earn points.

Screenshots

Game Screenshot

File Structure

.
├── images/
│   ├── background.jpg
│   ├── bullet.png
│   ├── enemyred.png
│   ├── enemyyellow.png
│   ├── gameover.png
│   ├── laser.png
│   └── ship.png
├── index.html
└── main.js

Game Logic Overview (main.js)

  • Canvas Setup: Creates and configures the HTML5 canvas.
  • Image Loading: Loads all necessary game assets (images).
  • Player Spaceship:
    • Controlled by arrow keys.
    • Shoots bullets with the spacebar.
  • Enemies:
    • Spawn at regular intervals.
    • Move down the screen.
    • Have their own HP.
  • Bullets:
    • Player and enemy bullets are handled separately.
    • Collision detection with ships.
  • Game Loop (main function):
    • Updates game state (update function).
    • Renders the game on the canvas (render function).
    • Uses requestAnimationFrame for smooth animations.
  • Game Over: The game ends when the player's HP drops to 0.

About

웹 기반 갤러그 스타일 게임

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors