Posts

New blog domain: kula.blog

It's still work in progress but new posts will be published on  https://kula.blog/ Thanks to 11ty base blog RSS is working from the start so it should be easy to add to your reader if you still use any :) If now then I hope you can sign up to the newsletter where I'll be publishing new posts and interesting articles to it from time to time. Please use  kula.blog  from now on.

Upcoming JS Events in Poland

List of JS events in Krakow: Meet.JS - 25 October:  https://www.facebook.com/events/473155186062813/ Eclipse Orion Hackathon - 26-28 October:  http://wiki.eclipse.org/Orion_Hackaton_Krakow_2012 Non JS: SCKRK - Software Craftsmanship Kraków (Lean Coffee) -  24 October:  http://www.meetup.com/sc-krk/events/86544362/ Warsaw: Node.js Weekend (Node Knockout) 9-12 November:  https://www.facebook.com/events/355157471238881/ I hope something like this will be in Kraków, it sounds fun :) Anyone will be interested? Other: I want to prepare presentation about HTML5 Games for internal-training in helloarcher.com. I blog less but I really use twitter all the time, if you want to read more fresh news go to  https://twitter.com/krzychukula . Recently I also started thinking about one blog post about all cool staff from the whole week, let me know if you have any ideas or if you like this One post a week idea. More events on end3r blog [PL]  ht...

onGameStart 2012

Image
This post was started just few days after onGamesStart but I have hard time finishing it. Talks were really good and I hope that my personal preferences and laziness will not affect great speakers with shorter reviews :) So let's start: Day 0:  Workshop with Kornel Lesinski & Peter van der Zee - Architecting canvas platformer game During this workshop you will learn about OOP, game loop, timers, tile maps, game editor, map and character collisions, animation and state transitions, NPC AI. Detailed walkthrough of example code of a fully playable platformer game. What I have learned Make your game small and distinct from drawing and input so that it can run on Node or in WebWorker :) So there should be class for Input handling to make it static instead of event driven, and Extract rendering to other Object than game-loop main Object. Thanks to this distinction you can create many different Renderers eg. one for mobile and one for web. With this ...

My Game: Canon Defense

Image
If you know about #js13kgames contest you might be interested in my small game created for it. I called it Cannon Defense, but the sole purpose of creating it was to learn in practice how to create a game. You can say that it looks ugly, or is small, but for me it was great co create it. My submission is not yet online so if you want, play it at:  http://krzychukula.github.io/js13k/ Code is on github:  https://github.com/krzychukula/js13k What I have learned: User constructor and prototype inheritance for game objects. function Bullet(x, y){ this.x = x; this.y = y; } Bullet.prototype.draw = function(ctx){ ctx.drawRect(x, y, 10, 10); } It will be more memory efficient. Do not use translations to move objects For me it was hard to manage bullets flying at various angles and the first idea was to translate all bullets to cannon position, then add some offset variable and just move bullet on one X or Y angle using offset. It worked :) Until I had ...

How to simulate slow connection (developer proxy in Node.js)

Image
Update: If you use Chrome then you can use "Throttling" so simulate slow network for all your assets. This should be easier than proxy. Toggle device mode   Choose Network type. Refresh the page https://developer.chrome.com/devtools/docs/device-mode  Proxy: For some time I wanted to use some proxy for development and testing of eg. slow internet connection, but it was hard to find something useful and free. I know there is Charles but buy it to use it at most one in a month is not for me. I started thinking about Node.js, maybe I can write proxy for me? But fortunately I found one. https://github.com/nodejitsu/node-http-proxy With this module I can write really short code to create slow server: var http = require('http'), httpProxy = require('http-proxy'); httpProxy.createServer(function (req, res, proxy) { var buffer = httpProxy.buffer(req); setTimeout(function () { proxy.proxyRequest(req, res, { host:...

Web Performance for the Curious

Image
Impressive presentation about whiteboxing WebKit and Chrome by Ilya Grigorik . I strongly recommend flags that are on slide 21: (Network internals of Chrome)  http://www.igvita.com/slides/2012/web-performance-for-the-curious/#21 chrome://predictors - omnibox predictor stats (tip: check 'Filter zero confidences') chrome://net-internals#sockets - current socket pool status chrome://net-internals#dns - Chrome's in-memory DNS cache chrome://histograms/DNS - histograms of your DNS performance chrome://dns - startup prefetch list and subresource host cache 60FPS is not only about games but pages too, so keep an eye on how much code you execute eg. on scroll event. 60FPS affords you a 16.6ms budget per frame http://www.igvita.com/slides/2012/web-performance-for-the-curious/#33 We can use GPU by: Forcing a GPU layer: -webkit-transform:translateZ(0) GPU is really fast at compositing, matrix operations and alpha blends http://www.igvita.com/slides/2012...

TJ Holowaychuk: Components

TJ posted on his blog about interesting idea to bring all connected content about eg. Popup and store it within one folder (or component). From that folder to component is easy to create some kind of package, package manager like npm (or I think that we can just use npm for this). More about idea:  http://tjholowaychuk.com/post/27984551477/components There are things that we must think before we create universal component (that can be used with jQuery, MooTools, YUI...). Make them extensible enough to use in big projects. TJ mentioned that at LearnBoost they use similar idea with server and client code in one component, this is really interesting but if such modules would be in npm registry then they would have dependencies like Express or jQuery, or some kind of MVC library. Another fragmentation issue is AMD vs Common.JS. I also think that Common.JS are more elegant but still now we have them both in community. I think about it with some kind of MVC and not only for ...

How to Disable Hiding of Menu items in Ubuntu

Image
For me this feature of hiding menu items in global menu is just annoying. Maybe there are people that doesn't need it, but I do, and it makes me longer to get there if I event can't see where it should be... So how to see menu items all the time? First install compiz-config: sudo apt-get install compizconfig-settings-manager example from:  http://ubuntuguide.net/how-to-change-unity-sidebar-launcher-auto-hide-behaviour-in-ubuntu-11-04 Then install revamped config: http://www.webupd8.org/2012/07/disable-global-menu-autohide-behaviour.html Next open ubuntu config as in post above but open Experimental tab and at the bottom check "Menu Always Visible". That's it :) But if you just doesn't want this you can remove it all together: http://www.liberiangeek.net/2012/04/disable-the-global-menu-in-ubuntu-12-04-precise-pangolin/