stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

19m 2s logged


Dev Vlog #9 — Added 2048 Game!


Hey everyone, welcome back to another WebOS update!

This time I made another popular game, 2048.

Some lines of code to make the tiles move and merge, like:

const moveRow = (row: number[]) => {
  const filtered = row.filter((value) => value !== 0);
  const result: number[] = [];

  for (let i = 0; i < filtered.length; i++) {
    if (filtered[i] === filtered[i + 1]) {
      result.push(filtered[i] * 2);
      i++;
    } else {
      result.push(filtered[i]);
    }
  }

  while (result.length < 4) {
    result.push(0);
  }

  return result;
};

I changed my mind at last to shift form minesweeper

It was pretty fun making 2048 and getting the tile movement and merging to work properly inside WebOS.

i will make minesweeper now!!!!!!

0
19

Comments 0

No comments yet. Be the first!