@mrklika/snake
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Snake

The classic snake game you know, powered by Angular.

This library was generated with Angular CLI version 13.3.0.

Installation

npm i @mrklika/snake

Usage

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { SnakeModule } from '@mrklika/snake';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [ AppComponent ],
  imports: [
    BrowserModule,
    SnakeModule
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }
<snake></snake>

Inputs

@Input()
startingPositions: Position[] = [
  { x: 20, y: 20 },
  { x: 30, y: 20 },
  { x: 40, y: 20 }
];

@Input()
boardSize = 300;

@Input()
speed = SpeedOptions.Slow;

@Input()
foodColor = '#61BB45';

@Input()
snakeColor = '#424242';

@Input()
showPoints = true;

Outputs

@Output()
pointsChanged = new EventEmitter<number>();

@Output()
gameStarted = new EventEmitter<boolean>();

License

MIT

Package Sidebar

Install

npm i @mrklika/snake

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

91.2 kB

Total Files

14

Last publish

Collaborators

  • mrklika