The Sinusoidal Tetris

2024-02-0615:5316852www.andreinc.net

A tetris game with a twist

less than 1 minute read

Let’s play Tetris, but with a twist. No geometrical figures will fall from the sky. Instead, you control a sinusoid, defined by: \(f(x)=A*sin(\omega x + \varphi)\):

(Source code)

Controls

  • To increase the angular frequency, \(\omega\), press: s;
  • To decrease the angular frequency, \(\omega\), press: x;
  • To increase the amplitude, \(A\), press: a;
  • To decrease the amplitude, \(A\), press: z;
  • To increase the phase: \(\varphi\), press: q;
  • To decrease the phase: \(\varphi\), press: w;
  • To drop the sinusoid, press p;

To win, you need to survive. The \(\sum\) of your sinusoids shouldn’t spike outside the canvas. If you are a savant, you can compute the Fourier Series coefficients in your head and keep the signal at 0. Good luck!

Remember, each time you win some, you lose some. Don’t be a loser.

There is The Path of Alternating Phases - when everything stagnates. This is boredom. Be a winner; fight the signal.

This game is a joke I put together during a weekend. I’m sorry for the graphics.

Updated:


Read the original article

Comments

  • By bberkgaut 2024-02-087:391 reply

    Reminds me of quantum soccer [1] from a short story by Greg Egan

    [1] https://gregegan.net/BORDER/Soccer/Soccer.html

    • By isoprophlex 2024-02-088:111 reply

      > The pairs of modes involved depend on the player’s velocity; the exact rules are spelt out in the mathematical details, but it’s easy to experiment using trial and error.

      Easy. This guy is truly in league of his own.

  • By bgoated01 2024-02-0814:10

    My first playthrough I quickly got it to where the amplitude was minimal, so then I just dropped low frequency low amplitude sinusoids for a while until I got bored. The following tries didn't go so well, but I guess even if I don't get the amplitude low I could still use the low frequency sines trick. I think this could be nice as a potential teaching tool for how sinusoids and waves combine. Sort of along the lines of this small game I made when I was a TA for an intro to acoustics class in college: https://goatesheard.com/ncg

  • By mnky9800n 2024-02-0711:183 reply

    This is wonderful. I think, ultimately it doesn't end up being a game as much as it is a wonderful way of looking at waveforms, simply because there is no goal except minimize. There should be an api so you can write code to pick the optimum changes for each drop.

    • By nomemory 2024-02-0711:49

      Hello, this game is part of an article I am currently writing. I will add there the "optimal" sinusoid :). Thank you for the idea.

    • By mckeed 2024-02-0816:45

      The goal is the same as Tetris – to last as long as possible before overflowing. This just doesn't have the mechanic of gradually getting faster.

    • By nomemory 2024-02-0912:25

      I've added the feature so you can see the first 4 optimal sinusoids.

HackerNews