blog.mailson.org


Hello, Jekyll

Three years after this blog was created, and many years after using wordpress as a blogging platform, I decided to migrate to Jekyll: a static website generator.

This post is not only intended to tell the readers that I moved to another platform but also explain why I did it, and what challenges I had to face.


My talk at Akademy

As I mentioned in a previous post, I talked about okular tiled-based engine at Akademy and, as I promised, I'm posting the slides used in the presentation.

If you weren't there you can sill watch my 30 minutes talk on the topic in the video bellow.


Akademy 2013

In a couple of weeks I'll be attending Akademy for the first time. This is a KDE annual event and this year will take place in Bilbao.

I'm really excited (and nervous) about it because I'll give a talk about my last year GSoC, which I developed a tiled based engine for Okular. I didn't finish my presentation yet but I'll focus on how the tiles are managed inside Okular (the talk will be quite technical).

I'm going to Akademy

Of course, I'll publish my presentation here in my blog. But only after (or during) my talk. I just hate spoilers :)

I hope to see you there.


Talk about building HTML5 games

Yesterday me and other two guys from INdT (luís gabriel and thiago figueredo) gave a talk about HTML5 games development at the Federal University of Pernambuco (Brazil). The audience was really awesome and even though it only lasted two hours and most of them never wrote a single line of JavaScript code, they could achieve to bootstrap a simple HTML5 game.

You can see the embedded presentation below or click in the direct link to the presentation.


Simple pong game using HTML5 and canvas

I've spend some time working on a simple game using canvas 2d. I had some problems while doing this (some hard to find) and I thought it would be great to share my experiences on this work.

This is a simple version of the well know game pong. Throughout this article I'll give some tips on how I treated the user's input (both keyboard and touch events), a word about collision detection and also troubleshooting some issues that came to me.

According to wikipedia:

Pong is a two-dimensional sports game that simulates table tennis. The player controls an in-game paddle by moving it vertically across the left side of the screen, and can compete against either a computer controlled opponent or another player controlling a second paddle on the opposing side. Players use the paddles to hit a ball back and forth. The aim is for a player to earn more points than the opponent; points are earned when one fails to return the ball to the other.

Introduction

I've used a basic object-oriented approach on top of JavaScript found on Mozilla developer network. In fact, that's not the only way of using object-oriented programming in JavaScript.

In the game we have a MainLoop() function which calls the game update and draw functions (in that order). The main loop is repeatedly called through a setTimeout.

The Game class* is the actual game. It controls each player movement, listens to user input and also call the draw methods.

*Although JavaScript doesn't actually have classes I'll use the term for a better understanding.