Why would you write Tetris in Vue.js?

Using an app framework to create a game doesn’t even make sense. Maybe you could have a part of an app that contains your Tetris code… but what sense does it make for Tetris to contain app framework code?

Accepting that it’s a dumb idea, I’m kind of interested in how it might look.

First of all, you can use Vue components to generated the DOM elements for the UI. What if you use Canvas instead of the DOM? I actually don’t know if Vue components have anything to do with Canvas… this exercise is already yielding learning opportunities.

Then there is the game state. It would be convoluted and slow, but I think you could use Vue to manage the state, maybe there would be a chance to demonstrate when to use Vuex vs when to keep state inside component hierarchies.

As a learning exercise there might be a lot to gain from stupid experiments like “let’s use this app framework as a game engine”.

I can come up with more stupid programming ideas, but they’re too embarrassing to write down.

Tags: practice experiments