LearntoCode.biz – Learn to code by solving puzzles

We’ve finally finalized our website for our game Machinist-Fabrique, and the site’s called http://learntocode.biz .
Machinist-Fabrique is a game where you learn to code by solving puzzles. The tools at your disposal are different code concepts. It’s fun and easy and suited for kids 10+ (and adults). We believe that learning to code is and will be an essential skill for our children and for ourselves.

Speed up MVC Visual Studio Development

Whenever I work with Visual Studio doing MVC development, I find that starting the web-site from a recompile takes far too long. So I asked my pal Tobias why it’s so fast when he’s doing it. The answer
I don’t do a full rebuild and I don’t attach the debugger
  1. Press Ctrl-F5 to start the website without the debugger
  2. Use the browser
  3. If you make changes,
    1. hit Shift-F6 to compile and update only the project of the file you’re currently in.
    2. if the solution has focus, the entire solution is rebuilt
    3. hit F5 to update the browser with the changes.
  4. If you need to debug attach the debugger by pressing Ctrl+Alt+P

Thanks, Tobias. I’m writing this blogpost so I won’t have to ask you again!

Machinist–Fabrique on IndieDB.com

My upcoming game, Machinist-Fabrique, is getting it’s own Indiedb entry – check it out at the link below (once it’s gone live, that is)

Machinist - Fabrique


R.U.B.E physics test of Machinist level


I’m working on a game called Machinist and I found this awesome tool called R.U.B.E. that lets me graphically design stuff for the Box2D Physics Engine. If you wish to play with Box2D, I warmly recommend try to start with R.U.B.E.

Designing this level using rube took a few hours (I’d never used the tool before). Doing it in code would have been impossible, because those shapes are way to finicky.


You know something’s amiss when you write this in your map editor;






And it looks like this in your renderer;








That’s just plain Worng!

OpenCL / CUDA konsult

Söker ni efter en erfaren konsult med kunskaper i OpenCL / CUDA programmering? Kontakta mig!

Här är några exempel på vad jag jobbat med;
AI (Neurala nätverk): http://sharprbm.codeplex.com/
Shaders: https://lotsacode.wordpress.com/2013/04/17/shadertoy/
Prtikelsimulering: https://lotsacode.wordpress.com/2013/04/16/fun-with-particles-yet-another-shader-editor/


ShaderToy is an site for writing and running WebGL shaders online.

Here are two screenshots from a Kaleidoscope shader I created;




Here’s the basic OpenCL code you’ll need to create your own kaleidoscope;

const int numPoints = 12;
const bool showFolds = false;

float rand( vec2 n ) {
	return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);

struct Ray
	vec2 point;
	vec2 direction;

float noise(vec2 n) {
	const vec2 d = vec2(0.0, 1.0);
	vec2 b = floor(n), f = smoothstep(vec2(0.0), vec2(1.0), fract(n));
	return mix(mix(rand(b), rand(b + d.yx), f.x), mix(rand(b + d.xy), rand(b + d.yy), f.x), f.y);

vec2 noise2(vec2 n)
	return vec2(noise(vec2(n.x+0.2, n.y-0.6)), noise(vec2(n.y+3., n.x-4.)));

Ray GetRay(float i)
	vec2 position = noise2(vec2(i*6.12+iGlobalTime*0.1, i*4.43+iGlobalTime*0.1));
	return Ray(
		normalize(noise2(vec2(i*7.+iGlobalTime*0.05, i*6.))*2.0-1.0));	

void main(void)
	vec2 uv = gl_FragCoord.xy / min(iResolution.x,iResolution.y);
	vec2 curPos = uv;
	for(int i=0;i<numPoints;i++)
		Ray ray=GetRay(float(i+1)*3.);	
		if(length(ray.point-curPos)<0.01 && showFolds)
			gl_FragColor.rgb = vec3(1,1,1);
		else if (length(curPos-(ray.point+ray.direction*0.1))<0.01 && showFolds)
			gl_FragColor.rgb = vec3(1,0,0);
			float offset=dot(curPos-ray.point, ray.direction);
			if(abs(offset)<0.001 && showFolds)
				gl_FragColor.rgb = vec3(0,0,1);
				curPos -= ray.direction*offset*2.0;
	gl_FragColor.rgb = texture2D( iChannel0, vec2(curPos.x,curPos.y) ).xyz;	
	gl_FragColor.a = 1.0;		

Get every new post delivered to your Inbox.