Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

canvas-game-example-the-tanks

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-game-example-the-tanks

Canvas the Tanks Game Example

latest
npmnpm
Version
1.2.5
Version published
Maintainers
1
Created
Source
import { Game } from 'canvas-game-example-the-tanks';

const game: Game = new Game({
  dynamicItemsMaxCount: 6,
  staticItemsMaxCount: 30,
  fps: 50,
  addEnemyThresholdMs: 5000,
  addStaticItemThresholdMs: 1000,
  playerHealth: 500,
  gameOverHandler: () => {
    // Handle game over
  }
});
const canvas = document.getElementById('canvasId');
game.init(canvas).start();

// You have access to player health and weapon like: 
// game.player.health, game.player.weapons

WSDA - move

left click - fire

Q (scroll) - switch weapon

T - teleportation to mouse position

See example at https://paul-lazunko.github.io/

FAQs

Package last updated on 22 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts