Giter Site home page Giter Site logo

tamagoji's Introduction

Tamagoji

Intro

Small command line nodejs app built for the technical test of Image Intelligence.

The game was developped with NodeJS, ESLint, and Jest.

The logic of how the tamagoji live is in the Tamagoji class. Interacting with an instance is done through the public methods.

Thanks to NodeJS single threaded event loop, we don't have to worry about concurrency.

Run the tests with npm test and start the game with npm start.

Pet

Your tamagoji has the following characteristics:

  • age (0..100)
  • health (0..5)
  • hunger (0..5)
  • fatigue (0..5)
  • isSleeping (true, false)
  • isClean (true, false)

To fulfill its need, a Tamagoji needs :

  • To be fed (feed command)
  • To be put to sleep (sleep command)
  • To be in a clean room (clean command)

All of those actions translates to user-generated events.

The system also generates the following events:

  • Every 8 seconds, your Tamagoji will lose 1 hunger point (hunger event)
    • Once your Tamagoji is hungry (hunger stat == 0), it will lose 1HP instead
    • 2s after eating, your tamagoji will poop (poop event)
  • Every 4 seconds, your Tamagoji will lose 1 fatigue point (fatigue event)
    • Once your Tamagoji is sleepy (fatigue state == 0), it will lose 1HP
    • After 20 seconds of sleepiness, your Tamagoji will fall asleep on its own (selfSleep event)
  • Once asleep, your tamagoji will sleep for 8s.
  • Every 50s, your tamagoji will age

The game is over and stops when your tamagoji dies or reach 100 years old.

tamagoji's People

Contributors

thbt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.