Posts

Simple canvas 2d physics

We were out playing pool a couple of nights ago. Instead of betting money on the games we used code-hours. I'm not very good at pool so in the end i was lucky to only owe my friend one code-hour. He wanted me to code a physics "demo" on a canvas element. Since i only had one hour to code we limited the "demo" to 2d and circles :) The implementation is quite ugly and the physics formulas are pretty much taken from an article at gamedev (which i can't find at the moment). Demo The result of my code-hour can be found at:    http://static.slackers.se/pages/javascript/canvas-simple-2d-physics/

Switching to Blogger

Image
After a couple of hours work I've switched platform to Blogger and it was easier than i thought. As a bonus i upgraded the theme to something with a little more colors. I've got the feeling that my old style (on the image) wasn't optimal, or as Mike put it , For the love of God, put some style on your links so we can see them Wordpress is a great platform with a lot of plugins and features. The only reason i switched was that I just don't have the energy to host Wordpress on my own server. Update to new versions, tweak the skin, fix plugin versions. Some of the posts don't quite work after the switch but i will go through and fix all of them, in time.

Ubiquity Spotify Search

A small Ubiquity command for searching Spotify . To be able to search you must have: The Spotify application installed on your system. Be able to open Spotify URI's from the browser . Download & Install The plugin can be installed and subscribed to at:   &nbsp http://static.slackers.se/pages/javascript/ubiquity-spotify The command can be downloaded from the subversion repository at:     ubiquity.spotify.js

jQuery floating header plugin 1.0.5 released

Finally i've fixed some of the bugs with the floating header plugin . I'm very proud that i've actually taken the time to fix these issues. - Great work Erik! - Thanks! The new version can be downloaded from the project page , jQuery or from the subversion repository .

Using tmpfs in /tmp

I've been stalling moving /tmp to RAM ever since i first bought a SSD for my computer last year. Now when i finally got the energy i read a bit about it and it was almost too easy. Just add this line to fstab then restart or run mount -a and it should work. tmpfs /tmp tmpfs defaults,nosuid,size=1024M,mode=1777 0 0 I'm pretty sure the mount options can be better tweaked. Here is an excerpt from the documentation . tmpfs has three mount options for sizing: size: The limit of allocated bytes for this tmpfs instance. The default is half of your physical RAM without swap. If you oversize your tmpfs instances the machine will deadlock since the OOM handler will not be able to free that memory. nr_blocks: The same as size, but in blocks of PAGE_CACHE_SIZE. nr_inodes: The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages, or (on a machine with highmem) the number of lowmem RAM pages, whichever is the lower.

Mask - the liero clone

Finally I've rewritten my little engine so that it is in a presentable state. The list of things I've tried and changed is huge but in the end it turned out pretty stable. It's gonna take a while to transform this preview into a real game though and i'm not sure i'm up for it actually. This feels like a release to me because it's playable :) Anyway what i need to do is roughly: Add a menu for game setup and changing controls Adding more weapons Adding powerups Implement some kind of sound support Get new graphics Controls Here are the controls for both players. I just realized that the keys might be placed very tight. I'm using a split natural keyboard so it works for me. Action Player 1 Player 2 Walk D,G,R,F Left, Right, U, Down Change Weapon Q Y Jump W U Shoot S J Ninja Rope Q+W Y+U Digg Hold one direction and tap the other You can also try experimenting with the mouse to add/remove ground and add particles. Applet If you're lik...

JFreeChart Legend Arrangement

When i was working with JFreeChart i found no way to layout the items of the legend box the way i wanted. I had no choice but to write a custom Arrangement . If anyone knows of a better way please enlighten me. ColumnFlowArrangement can layout on both the vertical and the horizontal axis. It works by specifying the width, in items, of the initial column. The column is filled with as many labels as there is room for, then a new column will be created with the same width. The arrangement works the same way for rows. The names of the arguments in the class can be a bit confusing but I will fix this and add factory methods to increase readability when I find the time/energy. The class can be found at: https://gist.github.com/bysse/6627232