Message from JavaScript discussions

April 2019

— Look at the test with a onclick event elxris it's an absolute success

— 

The event appears between the time and the counter when clicked, and then disappears after it's duration

— Which app bro

— Sololearn

— I'm on a trip so I can't use anything decent

— let time = null;
const func = null;
class Game {
constructor(pace, money){
this.hour = (a) =>{
a = Math.floor(this.startTime/60)
return (a > 23) ?a = 0 :a
};
this.minute = (a) => {
a = this.startTime%60
return (a < 10) ?'0'+a :a }
this.startTime = 464;
this.pace = pace;
this.money = money; //12
this.interval = null;
this.process = null;
}
displayTime(){
return this.hour() +':'+this.minute()
}
tick(){
return this.startTime++
}
play(...func){

const queue = (...func)=>{
for(let f of func){
return f()
}
}

this.interval = setInterval(()=>{
console.log(this.displayTime());
queue(...func)
this.tick()
console.log(time);
time++;}, 1000)
}
pause(){
return clearInterval(this.interval)
}
}
const newGame = new Game(1000, 10000);
time = newGame.startTime
const test =()=>newGame.pause()
setTimeout(test, 8000)

const test2 = () => console.log('walking')

const manage = (action, duration) => {
newGame.pause()
newGame.play(action)
const resume = () => {
newGame.pause()
newGame.play()
}
setTimeout(resume, duration)
}
newGame.play()

const testing = () => manage(test2, 4000)
setTimeout(testing, 3000)

Message permanent page

— It's a prototype just so you know guys

— But it works you can run a console

— What was your game about?

— It's going to be like a mix of the Sims and tamagochi

— Almost only text based

— I want to have characters living their life and interacting between each other