Personally, I think a little more feedback into what effect each action has would be good. I couldn't figure out if the buttons did anything at all except change the animation. Perhaps a status bar showing the hunger/thirst/boredom going up or whatever.
I think that this is supposed to be similar to the classic tamagotchi's off of the 90's. There were no status bars (like a real pet) and figuring it out was part of the charm . I do think that if the pet is really hungry/thirsty/tired there should be an a different animation, like pointing to mouth for hunger.
I agree animations and aesthetic are awesome (much better than the original LCD pixel Tamagotchi's).
I've never seen this pattern before in JS, in the parameters for the constructor. playing with it in the browser, I can see it lets you define default values for expected arguments when calling it but you can provide other values.
What is this called? I'd like to read more about it.
class Resource{
constructor({
min = 0,
max = 1,
count = 0
}={}){
this.min = min;
this.max = max;
this.count = count;
}
}
Love the game! It would be nice to wrap this up in an Android app and put it on the market place just because when I build games like these my kids end up closing the browser somehow :) I built a few of these at: http://putty.minhajuddin.com/
var ele = document.createElement('div');
ele.setAttribute('id', 'foo');
//$('.stage').append("<div id='foo'>m</div>");
document.getElementsByClassName('stage')[0].appendChild(ele);
I like the style of the code. Can talk about your inspiration for it? I haven't seen Javascript written in that way before. It's clean but, at least to me, unintuitive. What is your background?
Been a frontend dev for 10 years angular and react. You’re right it’s a little mix of functional state management and imperative structures for the game objects.
[+] [-] RugnirViking|6 years ago|reply
The animations and the aestetic are great though!
[+] [-] AllanHoustonSt|6 years ago|reply
[+] [-] clarkey252|6 years ago|reply
I agree animations and aesthetic are awesome (much better than the original LCD pixel Tamagotchi's).
[+] [-] jboy55|6 years ago|reply
[+] [-] nkrisc|6 years ago|reply
What is this called? I'd like to read more about it.
[+] [-] lxe|6 years ago|reply
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[+] [-] orisa2|6 years ago|reply
[+] [-] chiyc|6 years ago|reply
[+] [-] unknown|6 years ago|reply
[deleted]
[+] [-] yomansat|6 years ago|reply
[+] [-] ghostbrainalpha|6 years ago|reply
[+] [-] minhajuddin|6 years ago|reply
[+] [-] ben85ts|6 years ago|reply
[+] [-] JDiculous|6 years ago|reply
I'm just a developer, but seeing stuff like this really makes me want to learn design.
[+] [-] volkk|6 years ago|reply
[+] [-] ben85ts|6 years ago|reply
[+] [-] tofu_ink|6 years ago|reply
var ele = document.createElement('div'); ele.setAttribute('id', 'foo'); //$('.stage').append("<div id='foo'>m</div>"); document.getElementsByClassName('stage')[0].appendChild(ele);
var dict = { pain: { energy: 'paddle', waste: 'needs to fart' }, sad: { ideas: 'coffee' }, frustration: { fatigue: 'sleep', energy: 'food' // 'paddle' }, restless: { concentration: 'knit?', waste: 'fart' }, tired: { fatigue: 'needs sleep' } };
// happy concentration // estatic ideas / waste // restless waster
trigger = setInterval(function() { var s = getState(STATE); var msg = s.mood.name + ' ' + s.mood.reason ; if (dict[s.mood.name] && dict[s.mood.name][s.mood.reason]) msg = dict[s.mood.name][s.mood.reason]; var other = ['concentration','energy','fatigue','ideas','waste']; for (var i = 0; i < other.length; ++i) msg += ' ' + other[i] + ':' + (s.creature[other[i]].count).toFixed(1);
}, 100)/* i couldnt find the mute button */ function playSound(state, sound){}
[+] [-] dynamite-ready|6 years ago|reply
[+] [-] throwaway35784|6 years ago|reply
[+] [-] ben85ts|6 years ago|reply
[+] [-] beaconstudios|6 years ago|reply
[+] [-] rmetzler|6 years ago|reply
[+] [-] ben85ts|6 years ago|reply
[+] [-] workthrowaway|6 years ago|reply
[+] [-] trianglem|6 years ago|reply
[+] [-] Fnoord|6 years ago|reply
[+] [-] Aeolun|6 years ago|reply
Reminds me of my son until he was 1 year old(ish).
[+] [-] mobilemidget|6 years ago|reply
[+] [-] tobyhinloopen|6 years ago|reply
[+] [-] ben85ts|6 years ago|reply
[+] [-] natex|6 years ago|reply
[+] [-] htk|6 years ago|reply
[+] [-] ben85ts|6 years ago|reply
[+] [-] ravenstine|6 years ago|reply
[+] [-] t0astbread|6 years ago|reply
[+] [-] unknown|6 years ago|reply
[deleted]
[+] [-] shakna|6 years ago|reply
Ignoring that, it seems a fun little thing. I have trouble understanding the faces, but I assume that just takes practice.
It's pretty neat, fast, with the all-important cute animations that trick you into caring about a state machine.
[+] [-] ben85ts|6 years ago|reply
[+] [-] CamperBob2|6 years ago|reply
[+] [-] fredley|6 years ago|reply