1.0.2 • Published 4 years ago

@ng-casino/rock-paper-scissors v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Rock, Paper, Scissors

This is an Angular component which provides an online implementation of a simple game of Rock, Paper, Scissors.

Latest version: 1.0.2

Rock, Paper, Scissors

Installation

$ npm install @ng-casino/rock-paper-scissors

Usage

Add RockPaperScissorsModule to your AppModule:

import {RockPaperScissorsModule} from '@ng-casino/rock-paper-scissors';

@NgModule({
  declarations: [AppComponent],
  imports: [
    RockPaperScissorsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Basic usage of the component:

<casino-rock-paper-scissors></casino-rock-paper-scissors>
Options
RequiredDescription
startTextNoThe text to display at the start of the game. Default is 'Make your choice'.
wonTextNoThe text to display after a winning game. Default is 'You have won this game!'.
lostTextNoThe text to display after a losing game. Default is 'You have lost this game!'.
drawTextNoThe text to display after a tie. Default is 'There is no winner in this game!'.
tryAgainTextNoThe text to display in the try again button. Default is 'Try again'.
imagesNoYour own images to use instead of the default rock, paper, scissors images.
(onPlaying)NoA callback which is called after the game has started or restarted.
(onGameResult)NoA callback which is called after you and your opponent have made their decision.