Shiny Contest Submission: Tetris-like game using Nanopore Flongle screenshots as starting fields



Introducing PoReTris: a Tetris-like game using Nanopore Flongle screenshots as starting fields.

This game was inspired by tweets from Ken McGrath and John Tyson. In its basic form, it can be played like Tetris (using arrow keys and the space bar, or the buttons), and the game finishes once all the starting blocks are cleared. For anyone with a MinION Flongle flow cell (or access to twitter), flow cell screenshots can be used to change the starting field.

Interesting features:

  • Uses a DNA sequencer to change the game [i.e. ONT Nanopore is now literally a game changer]
  • Interactive game, uses a timer loop to update the game field
  • javascript keyup/keydown hooks to provide keyboard input
  • Field hash value to allow people to brag about how well (or poorly) they can play the game


An example image is provided in the base repository, taken from a frame of this tweet:

In order to convert the flow cell screenshot into a starting matrix, I pre-process the image to identify grid-like features, and use green and blue intensity levels to determine the nature of the grid elements. The behaviour on non-Flongle images is undefined. In particular, it doesn't work well for the screenshots I have for standard MinION flow cells.

I haven't worked out how to stop the timer while a file is being selected, so it's possible that the game can finish while someone is picking out a new image.


The associated GitLab repository can be found here (should be mirrored by the RStudio Cloud project):


@gringer looks great! I was not able to access the RStudio Cloud project. Can you check that it's public?


Sorry, I didn't realise I needed to do that. I've just now set the access to 'Everyone'; hopefully that has fixed it.


Works great, thanks!

closed #6

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

opened #7