A project based on cookie clicker game http://orteil.dashnet.org/cookieclicker/
For development, you will only need Node.js installed on your environement.
Node is really easy to install & now include NPM. You can use YARN instead of npm if you like. You should be able to run the following command after the installation procedure below.
$ node --version
v0.10.24
$ npm --version
1.3.21
You will need to use a Terminal. On OS X, you can find the default terminal in
/Applications/Utilities/Terminal.app
.
Please install Homebrew if it's not already done with the following command.
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
If everything when fine, you should run
brew install node
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Just go on official Node.js website & grab the installer.
Also, be sure to have git
available in your PATH, npm
might need it.
$ git clone https://github.com/piotpap663/cookieclick.git
$ cd cookieclick-master
$ npm install
#or
$ yarn install
$ npm dev-server
#or if you use yarn
$ yarn run dev-server
It will run app on localhost server Just check the ip and port on your command lines Put the address in your browser and it'll works
localhost:8080
# Add new div element to index.html
<div id="producer-grandpa" class="producer"></div>
# constructor values
# new Producer(DOMid, name, baseCost, perSecond);
# DOMid - element id [string],
# name - name of producer [string],
# baseCost - cost for buying one producer,
# perSecond - How many cookies produce per one second
const grandpa= new Producer("producer-grandpa", "Grandpa", 130000, 260);
game.listOfProducers.push(grandpa);
Inside constructor of Game class you will find a time intervals declaration
renderProducersTime - rendering List of Producers
renderBigCookieTime - rendering how many cookies we have
#game.js
class Game {
constructor() {
this.renderProducersTime = 400; // ms
this.renderBigCookieTime = 100; // ms
}
$ npm build
#or if you use yarn
$ yarn run build
- Piotr Papiernik - LinkedIn
This project is licensed under the MIT License