profile

What is it about?

Well about me, Martijn Casteel, as easy as that!

A lone writer, writing about some thrilling encounters mainly in IT. First exciting point to elaborate; Who am I? Quoted from a strange movie with Jackie Chan. Well I'm not that old (yet) and I do like programming.

I'm an IT guy, I've studied Computer Science and Technical Artificial Intelligence. The latter is quite long and I have to explain it every time, so the short version is I'm building Jarvis.

I like watching movies among many other hobbies you may, or may not, find out reading my blog!


A simple game

11 November 2020

To try something new I got the idea to create a very basic game. It’s just for fun! And as you can see it appears to be pong, a classic. This game works on laptop with the arrow keys and with your thumb on mobile devices. It is build with plain javascript and fun to do.

Like more game platforms it calculates new positions, possible collisions, and then it will draw the result on the canvas. Repeating this over and over you’ll get a game reaching around 60fps. It will also pause the game if you’re in a different tab.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// request frames to update values and render the game
window.onload = function() {
  window.requestAnimationFrame(loop)
};

// calculate new positions and draw on canvas
let loop = function() {

  update();
  render();

  // creating a loop, with around 60 loops per second
  window.requestAnimationFrame(loop);
};

I couldn’t find a nice font that worked with these large texts. So I made my own letters, each of them with a height of 7 blocks. Each character has a variable width, but all letters had a width of 5 and the numbers 6 across. Using a simple array I would know where to draw a rectangle creating a letter. Each rectangle had a variable size. It was not really nessesary but fun to do!

For now you play against a simple AI which improves if your score increases. The game ends if you have a score of 16, good luck!

1
2
3
// some hints if you're having a hard time
pong.player.width = 450
pong.score = 15

In between projects

20 September 2019

At the moment I’m in between projects, I worked a lot on koala. It has been five years since we started this project, and it was fun to do. Other members of the study association are continuing work on koala.

At the moment I’m planning a new project. A 16 by 16 led frame for animating images. I have my inspiration from the Game Frame, a project by Jeremy Williams. However his Game Frame is sold out. So I’m planning to create my own. I have bought a WS2812b led strip for my first build and a picture frame. I would like to use a PCB prototype manufacturer, perhaps even with SMT assembly.

Instead of using an Arduino, I will be using a Raspberry PI Zero W. A few plans using this additional computational power; using a web interface to add, order, and remove animations. The device should create a network if none is configured, after reboot the configured wifi is used. And finally, the web interface could get an editor to create animations painting any of the 256 boxes.