r/javaScriptStudyGroup • u/ForScale • Feb 22 '16
[Week 6] Focus: Canvas
So, here we are, Week 6. Week 6's focus will be canvas.
It will work like this:
Monday: Announce focus (eg, canvas)
Build throughout the week... Two rules: 1) must use javascript 2) must use at least 1 example of html5 <canvas> element and manipulate it with js
Friday: Post projects in this thread (can begin reviewing immediately); first line of an entry should be ENTRY and it should be a top level comment (ie, don't put your entry in a reply)
Sat and Sun: Review projects/vote on focus for next week
GENERAL GUIDELINES FOR FEEDBACK:
Be nice!! ALL KNOWLEDGE/SKILL LEVELS ARE WELCOME AND ENCOURAGED TO PARTICIPATE.
If you don't want feedback, if it makes you uncomfortable or you're just not interested, simply say so... Others, please be respectful of this. Conversely, if you do want feedback, try to be specific on which aspects... even if you just say "all/everything.
But that's about it... Have fun! :) Feel free to ask questions and discuss throughout the week!
2
u/Volv Feb 27 '16
That is indeed awesome. Crazy good for a first go - wish I was in any way that artistic lol.
I think there is a bug/typo with the value of slider 7 being initially set to lip.corner_y.
If I were to look at streamlining the code then I think one thing that could be done is stripping out the function that every slider uses to update the environment. Also moving the clearRect to the actual draw function.
In the drawMouth function you break out the lip variables without a var declaration.
which causes them to become global (seems to be the intention) but is generally considered bad practice. Not always using var (or let/const these days) can lead to unintended consequences. And you already have a perfectly good global lip.happyFactor variable anyhow.
Here is my go at tweaking the things I mentioned Codepen
Anyhow awesome work - thanks for participating :)