Using Canvas and WebSockets to create Tetris for Vaadin

Hi all,

As a part of my presentation I came up with this limited version of Tetris game. It is basically a showcase for using websockets and canvas with Vaadin.

If you are lucky there is a live version at
(lucky because of the SLA of the very low-cost server Matti offered me for this demo). Using the buttons is awkward, but there are also keyboard bindings for arrows and spacebar.

However, the main point here is how little UI code was neede to actually build the game. Source code is available here:

(…and yes, it is running on the server-side. It does not make too much sense with the current feature set, but just think of multiplayer version :slight_smile: )


Sami’s approach is similar to what I did for my Scala & HTML5 presentation at Devoxx. I didn’t use server push though, just simple client side polling using the
Refresher add-on

Details in this post:

I’ll try to get a online demo up soon.

That’s sooo cool! :open_mouth:

The demo is now moved to


Tetris forever! :slight_smile:

Thanks to Matti, Vaadin websockets demo app was just updated for Java 8 and Vaadin 7.4: