1.0.1 • Published 2 years ago

@mrklika/snake v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

1.0.1

2 years ago

1.0.0

2 years ago

0.0.2

2 years ago

0.0.0-watch

2 years ago

0.0.1

2 years ago