Out of fresh ideas this week. Nevertheless, it's OK to write a little code just for practice. Let's play JS to Coffee porting game (without using js2coffee ). A nice candidate: KineticJS example - colorful and short. Let's make it even shorter! Check the original example, it has js code about 50 lines long, something has to be done immediately! Btw, they also provide a code editor and let you to see your changes' effects, which is cool. Lots of respect to HTML5 Canvas Tutorials .
A canvas moonstruck by KineticJS may look like this:
Meanwhile, a more basic example: KineticJS initialization, adding shapes to a layer:
Try them - they're said to be draggable in the code, and they are:
Check the new CoffeeScript code, it's 30 lines vs 50 in the original JS example. Checkout full html to edit and have fun. Enjoy!
No comments:
Post a Comment