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
vehje.tahvonen.fi:8080/vaadin-tetris/
(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:
github.com/samie/JavaDayRiga2011

(…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: )

Nice!

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:
https://vaadin.com/forum/-/message_boards/view_message/530126#_19_message_976577

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

That’s sooo cool! :open_mouth:

The demo is now moved to
http://v3.tahvonen.fi/tetris/

cheers,
matti

Tetris forever! :slight_smile:

Thanks to Matti, Vaadin websockets demo app was just updated for Java 8 and Vaadin 7.4:
https://github.com/samie/VaadinTetris