Friday, March 28, 2014

Monday, February 24, 2014

Jumpy Fox

I have just released an Android game called Jumpy Fox.
Obviously, this game was inspired by the Flappy Bird hype, but birds are out and FOXES ARE IN!


As a player of the game you have to help the little jumpy fox to jump over the trunks.

 * Easy to get get started, yet challenging to get a good score
 * Game speeds up after a while to make it even more challenging
 * Beautiful charcoal drawing style UI elements
 * Compare your highscore with opponents and friends world wide via Google Play Game Services

Sunday, September 29, 2013

ColBrix

I have finally released ColBrix, a tile-based game for Android.
It's inspired by other apps and tile-laying board games like Scrabble, Qwirkle, WordFeud, etc., but it has its unique set of rules.


The code for the game has been untouched for more than a year, for the following reason: 
I wanted to make a really good tutorial, and I knew such a tutorial would require a lot of time to implement. But I've never had that time.

Until I (yesterday) decided to turn a missing tutorial into a feature. I think, that deliberately not offering a tutorial makes the game actually more attractive. There's space to explore the rules, the way the points are calculated, and keeps the game play interesting for a longer time span.

Actually, it became the slogan of ColBrix: Finding out the rules is part of the game!

With that decision, I could release the app in less than a day (after polishing up some parts of the app). I'm very glad that it's finally out (I hate unfinished projects ;)), and hope that you like the game.



Have fun!


Monday, April 15, 2013

Arduino-Powered Maneko Neki

Yet another very practical project that will enrich your life. Extremely hard to make, believe me (just look at the complicated circuit, and you can guess how complicated the code is).



Check out http://arduino.cc and get started yourself.

Sunday, March 3, 2013

Arduino Project - Screen's Brightness Determines Sound (or: JavaScript powered Light Theremin)

I just finished my first Arduino project. Its individual components are very basic, but I love the combination of them.

Check this out:

The Arduino code is fairly simple, it takes the light sensor's value (a value between 0 and 1024 (well, in fact it's a smaller range, because the screen's black is somewhere around 900, and white is about 200)) and maps it to various tones (again a value between 0 and 1024) that I send to the Piezo speaker.

What you can see on the screen is a simple HTML page, whose background is changed for each tone. Here's a sketch of how it works:


var c4 = 0, cs4 = 1, d4 = 2, ds4 = 3, e4 = 4, f4 = 5 ... as5 = 22, b5 = 23;

var melody = [  
  e5, ds5, e5, ds5, e5, b4, d5, c5, a4,a4,a4,
  c4, e4, a4, b4,b4,b4, e4, a4, b4, c5,c5,c5, ...];

function playSong() {
  var intervals = 24; // supports 2 octaves
  for(var i = 0; i < melody.length; i++) {
    var note = melody[i];
    var lumin = 100 - 100/intervals*note;

    // http://stackoverflow.com/a/6425113
    setTimeout( (function(lumin) { return function() { changeBackground(lumin); } })(lumin), i*250);
  }
}


function changeBackground(lum) {
  document.body.style.backgroundColor="hsl(0,0%,"+lum+"%)";
}


Edit 2013-03-09:
I put the source code on GitHub - https://github.com/bodnerdan/js-arduino-theremin  

Looking forward to get some feedback, or even pull requests.
As you can guess, it didn't take me very long to implement this code, but I'd rather see it as a seed for inspiration for better, bigger projects. Let me know if you have used my code as a basis to create something more sophisticated.

Thanks for reading!

Monday, July 2, 2012

Miniature Photo Album with ImageMagick (montage, convert) and Some Shell Scripting

How to develop photos smaller than 13x9, 15x11...

The fork is just there to indicate the size of the photos
When ordering photos online, you usually have the option to choose between formats like 13x9cm, 15x11cm, etc. However, none of these digital photo online services (that I know) offers smaller sizes. This post describes how to easily "merge" 4 JPG files into a big one (containing these 4 files in a 2x2-grid), which you can then order online and cut with scissors (or your other favorite cutting device) in order to create an album with photos of the size 7.5x5.5cm (or smaller, by adjusting some parameters)

Important: The shell script shown below does not touch the original files (it copies and rotates them). However, I don't give any warranty that you don't lose or ruin your original files, so make sure to have a backup!

Prerequisites

  • A set of JPEG images (optimally the same aspect ratio in order to get a seamless montage)
  • An installation of ImageMagick (the executables have to be in the $PATH)
  • A bash-terminal

How to do it

  • Move all the JPG files in a directory
  • cd into this directory and create an executable script with the content from below
  • Execute the script and wait
  • After that, the subdirectory generated contains the files you might want to upload to your online photo service  


#!/bin/bash

g=generated
t=$g/tmp

mkdir -p $t

### STEP 1 - cloning/rotating the file to 'portrait' 
### into the temporary subdirectory(0.jpg, 1.jpg, etc.)
i=0
IFS=$'\n'
for file in `find . -type f -iname "*.jp*g"`
do
 echo "rotating file $file into $t/$i.jpg"
 convert "$file" -rotate '90>' $t/$i.jpg

 let i=i+1
done


### STEP 2 - take 4 JPG files at a time 
### and compile them into new 2x2-images 
i=0
nroffiles=`ls $t/*.jpg | wc -w`
let nrofiterations=nroffiles/4
while [ $i -lt $nrofiterations ] 
do
 ## helper variables to access file names
 let f=i*4
 let a=f+0
 let b=f+1
 let c=f+2
 let d=f+3
 echo "creating a$i.jpg ($a.jpg $b.jpg $c.jpg $d.jpg)"

 ## compile the 4 separate images into a 2x2-grid. 
 ## please change the parameter 768x1024 if you 
 ## don't have a 3:4 aspect ratio
 montage $t/$a.jpg $t/$b.jpg $t/$c.jpg $t/$d.jpg -tile 2x2 -geometry 768x1024 $g/a$i.jpg
 let i=i+1
done

### remove the tmp directory
rm -rf $t



The images created by this script look somewhat like this one (individual pictures taken from http://www.freeimages.co.uk/)


Not very advanced stuff, I know, but I think it's a nice combination of some handy tools to make a nice present.

P.S. 1: I know that there are more elegant ways to write the shell-script, but for my purposes and skills this was the quickest way to go.

P.S. 2:  I think the 7.5x5.5cm format is optimal for a flip book. Wouldn't it be easy and fun to create your own flip book story with the continuous shooting mode of your digital camera?

Friday, April 6, 2012

ImageUploader as Java Web Start

In older blog posts I reported about my ImageResizer/Uploader appplication.
A while ago I turned it into a Java Swing application, startable via Java Web Start.

Short description
It's a tiny but very useful software to resize and upload a bunch of JPG-files to a Google Picasa Web Album. It´s perfectly suitable for travellers in countries with slow Internet connections. The idea behind this software is the following: A full-sized JPG files on a digital camera with (let´s say) 3 MB has only 300 KB if it is resized to 70% of its original size, but has (nearly) the same quality. So Internet-backups can be made 10-times as fast.

You can find it here:
https://sites.google.com/site/dbimageuploader/home

Please don't forget to read the "Background" section:
https://sites.google.com/site/dbimageuploader/background