return to table of content

1D Pac-Man

mrb
28 replies
18h49m

Here, I found it fun to write a small bot to play automatically. Just paste this JS code in the dev console. It reached 9000 points on my first attempt to let it run. Feel free to tweak the code to make pac-man survive longer :-)

    function bot() {
        /* direction of the enemy: to our right (1) or to our left (-1) */
        dir = (enemy.x > player.x) ? 1 : -1;
        /* if pac-man... */
        if (
            /* ...has no powerup or powerup expires in less than 10 "ticks" */ powerTicks < 10 &&
            /* ...is headed toward enemy */ player.vx == dir &&
            /* ...is too close to enemy */ abs(player.x - enemy.x) < 25 &&
            /* and if enemy's state is not "eyes flying back" */ enemy.eyeVx == 0
        ) {
            // "ArrowUp" or any arrow key reverses the direction of pac-man
            document.dispatchEvent(new KeyboardEvent('keydown', {code: 'ArrowUp'}));
            document.dispatchEvent(new KeyboardEvent('keyup', {code: 'ArrowUp'}));
        }
    }
    setInterval(bot, 100);
The strategy is ultra simple. Every 100 ms it evaluates the situation and chooses to move away from the enemy (ghost) if it's too close to it, and has no powerup (or if the powerup is expiring very soon).

The corner cases where pac-man dies is the game difficulty progressively increases (the ghost becomes faster) until you eat it, so sometimes some pellets are left in the middle and pac-man doesn't have enough time to eat them until the ghost reaches it. The ghost will progressively get faster and faster and death is guaranteed. You could improve the code by tempting the ghost to get close to one edge, then cross over to the other edge and quickly eat the middle pellets.

Also, as soon as new pellets are added, one should prioritize eating the middle pellets.

Also, one could add code to detect the powerup pellets, and chose to NOT move away from the ghost if it calculates it can eat the powerup pellet before the ghost reaches pac-man.

irjustin
8 replies
17h22m

This is super awesome!

The trouble I ran into was after eating the ghost, the spawn point of the new ghost was too close to my current position and simply sped over me.

With this and all the considerations you've noted above, I'd probably throw an ML solution at it - imagine it takes less coding time.

wegfawefgawefg
3 replies
14h7m

deep reinforcement learning guy here. Youre looking at coding up double dqn, and probably training it for about 5 to 30 minutes. Very likely it would not outperform a simple near perfect algorithm, and would fail in some weird ways that would annoy you a few tens of thousands of times. Youd have issues like it refusing to go left, ever, after dying. So youd need to know about epsilon then epsilon decay etc.

Coding that from nothing (and understanding it) could take days. Weeks to months if you dont know ml stuff.

In this particular case I think basic Q Tabular Learning could play optimally, no neural net required.

I could be wrong though, throw a full conv at it without temporal difference and see what happens! (probably a kinda okayish score)

eru
2 replies
13h58m

You could probably throw a small fully connected net at it, and 'train' it via genetic algorithms: ie have a population of nets, let them each run a few games, and pick a few top scorers to seed the next generation with some mutation and cross-over.

This random exploration is less efficient than back propagation, but at least you don't have to muck around with temporal differences. (And it would be hard to figure out how to tweak the weights for backpropagation in this multi-step game; without falling back to reinforcement learning.)

The problem seems simple enough that evolution via mutation and artificial selection has a decent chance to get good in a reasonable amount of computing time.

wegfawefgawefg
0 replies
13h23m

NEAT? An added bonus of the evolutionary neural search is that you can still explore the solution space with small networks, which isnt really true of backpropogation without evolution. You run out of states.

Matumio
0 replies
1h42m

With the right small neural network architecture you could probably just repeat random weight initialization until you find one that works. This is known to work for some of the Atari games. The trick is, of course, to engineer a good input encoding and to find the right model complexity and architecture in the first place.

pushedx
2 replies
15h23m

The script took, at most, 5 hours to write (inclduing the time for this poster to play the game, understand the game, reverse engineer the game, and implement a bot). What type of "ML solution" to the same problem would take less than 5 hours?

mrb
0 replies
8h48m

For the record, it took me about 30 minutes of playing, reverse-engineering, and writing the bot. So, indeed, no need for an ML solution :)

eru
0 replies
13h57m

You are right about the time, but 1D Pac-Man might still be a good fun toy problem to hone your ML skills on.

kqr
0 replies
7h55m

This sounds like a simple enough problem that one could work out a provably optimal algorithm in less time than it takes to get even a non-optimal ML solution working.

But both approaches would be an interesting exercise in their respective domain!

Come to think of it, it might even be an interesting toy problem for a SAT solver! Overkill in the same way as an ML approach, of course.

artisandip7
7 replies
11h47m

something similar

  eval(atob('ZnVuY3Rpb24gdXBkYXRlKCkgewogIGlmICghdGlja3MpIHsKICAgIHBsYXllciA9IHsgeDogNDAsIHZ4OiAxIH07CiAgICBlbmVteSA9IHsgeDogMTAwLCBleWVWeDogMCB9OwogICAgbXVsdGlwbGllciA9IDA7CiAgICBhZGREb3RzKCk7CiAgICBwb3dlclRpY2tzID0gYW5pbVRpY2tzID0gMDsKICB9CiAgYW5pbVRpY2tzICs9IGRpZmZpY3VsdHk7CiAgY29sb3IoImJsYWNrIik7CiAgdGV4dChgeCR7bXVsdGlwbGllcn1gLCAzLCA5KTsKICBpZiAoaW5wdXQuaXNKdXN0UHJlc3NlZCkgewogICAgcGxheWVyLnZ4ICo9IC0xOwogIH0KICBwbGF5ZXIueCArPSBwbGF5ZXIudnggKiAwLjUgKiBkaWZmaWN1bHR5OwogIGlmIChwbGF5ZXIueCA8IC0zKSB7CiAgICBwbGF5ZXIueCA9IDEwMzsKICB9IGVsc2UgaWYgKHBsYXllci54ID4gMTAzKSB7CiAgICBwbGF5ZXIueCA9IC0zOwogIH0KICBjb2xvcigiYmx1ZSIpOwogIHJlY3QoMCwgMjMsIDEwMCwgMSk7CiAgcmVjdCgwLCAyNSwgMTAwLCAxKTsKICByZWN0KDAsIDM0LCAxMDAsIDEpOwogIHJlY3QoMCwgMzYsIDEwMCwgMSk7CiAgY29sb3IoImdyZWVuIik7CiAgY29uc3QgYWkgPSBmbG9vcihhbmltVGlja3MgLyA3KSAlIDQ7CiAgY2hhcihhZGRXaXRoQ2hhckNvZGUoImEiLCBhaSA9PT0gMyA/IDEgOiBhaSksIHBsYXllci54LCAzMCwgewogICAgLy8gQHRzLWlnbm9yZQogICAgbWlycm9yOiB7IHg6IHBsYXllci52eCB9LAogIH0pOwogIHJlbW92ZShkb3RzLCAoZCkgPT4gewogICAgY29sb3IoCiAgICAgIGQuaXNQb3dlciAmJiBmbG9vcihhbmltVGlja3MgLyA3KSAlIDIgPT09IDAgPyAidHJhbnNwYXJlbnQiIDogInllbGxvdyIKICAgICk7CiAgICBjb25zdCBjID0gY2hhcihkLmlzUG93ZXIgPyAiZyIgOiAiZiIsIGQueCwgMzApLmlzQ29sbGlkaW5nLmNoYXI7CiAgICBpZiAoYy5hIHx8IGMuYiB8fCBjLmMpIHsKICAgICAgaWYgKGQuaXNQb3dlcikgewogICAgICAgIHBsYXkoImp1bXAiKTsKICAgICAgICBpZiAoZW5lbXkuZXllVnggPT09IDApIHsKICAgICAgICAgIHBvd2VyVGlja3MgPSAxMjA7CiAgICAgICAgfQogICAgICB9IGVsc2UgewogICAgICAgIHBsYXkoImhpdCIpOwogICAgICB9CiAgICAgIGFkZFNjb3JlKG11bHRpcGxpZXIpOwogICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KICB9KTsKICBjb25zdCBldnggPQogICAgZW5lbXkuZXllVnggIT09IDAKICAgICAgPyBlbmVteS5leWVWeAogICAgICA6IChwbGF5ZXIueCA+IGVuZW15LnggPyAxIDogLTEpICogKHBvd2VyVGlja3MgPiAwID8gLTEgOiAxKTsKICBlbmVteS54ID0gY2xhbXAoCiAgICBlbmVteS54ICsKICAgICAgZXZ4ICoKICAgICAgICAocG93ZXJUaWNrcyA+IDAgPyAwLjI1IDogZW5lbXkuZXllVnggIT09IDAgPyAwLjc1IDogMC41NSkgKgogICAgICAgIGRpZmZpY3VsdHksCiAgICAwLAogICAgMTAwCiAgKTsKICBpZiAoKGVuZW15LmV5ZVZ4IDwgMCAmJiBlbmVteS54IDwgMSkgfHwgKGVuZW15LmV5ZVZ4ID4gMCAmJiBlbmVteS54ID4gOTkpKSB7CiAgICBlbmVteS5leWVWeCA9IDA7CiAgfQogIGNvbG9yKAogICAgcG93ZXJUaWNrcyA+IDAKICAgICAgPyBwb3dlclRpY2tzIDwgMzAgJiYgcG93ZXJUaWNrcyAlIDEwIDwgNQogICAgICAgID8gImJsYWNrIgogICAgICAgIDogImJsdWUiCiAgICAgIDogZW5lbXkuZXllVnggIT09IDAKICAgICAgPyAiYmxhY2siCiAgICAgIDogInJlZCIKICApOwogIGNvbnN0IGMgPSBjaGFyKAogICAgZW5lbXkuZXllVnggIT09IDAgPyAiaCIgOiBhZGRXaXRoQ2hhckNvZGUoImQiLCBmbG9vcihhbmltVGlja3MgLyA3KSAlIDIpLAogICAgZW5lbXkueCwKICAgIDMwLAogICAgewogICAgICAvLyBAdHMtaWdub3JlCiAgICAgIG1pcnJvcjogeyB4OiBldnggfSwKICAgIH0KICApLmlzQ29sbGlkaW5nLmNoYXI7CiAgaWYgKGVuZW15LmV5ZVZ4ID09PSAwICYmIChjLmEgfHwgYy5iIHx8IGMuYykpIHsKICAgIGlmIChwb3dlclRpY2tzID4gMCkgewogICAgICBwbGF5KCJwb3dlclVwIik7CiAgICAgIGFkZFNjb3JlKDEwICogbXVsdGlwbGllciwgZW5lbXkueCwgMzApOwogICAgICBlbmVteS5leWVWeCA9IHBsYXllci54ID4gNTAgPyAtMSA6IDE7CiAgICAgIHBvd2VyVGlja3MgPSAwOwogICAgICBtdWx0aXBsaWVyKys7CiAgICB9IGVsc2UgewogICAgICBwbGF5KCJleHBsb3Npb24iKTsKICAgIH0KICB9CiAgcG93ZXJUaWNrcyAtPSBkaWZmaWN1bHR5OwogIGlmIChkb3RzLmxlbmd0aCA9PT0gMCkgewogICAgcGxheSgiY29pbiIpOwogICAgYWRkRG90cygpOwogIH0KfQ=='))
when tired just call end()

probably better to manipulate the score directly but its not fun that way :)

tlrobinson
5 replies
11h7m

Not sure why you obfuscated it but here's the code for anyone curious:

    function update() {
      if (!ticks) {
        player = { x: 40, vx: 1 };
        enemy = { x: 100, eyeVx: 0 };
        multiplier = 0;
        addDots();
        powerTicks = animTicks = 0;
      }
      animTicks += difficulty;
      color("black");
      text(`x${multiplier}`, 3, 9);
      if (input.isJustPressed) {
        player.vx *= -1;
      }
      player.x += player.vx * 0.5 * difficulty;
      if (player.x < -3) {
        player.x = 103;
      } else if (player.x > 103) {
        player.x = -3;
      }
      color("blue");
      rect(0, 23, 100, 1);
      rect(0, 25, 100, 1);
      rect(0, 34, 100, 1);
      rect(0, 36, 100, 1);
      color("green");
      const ai = floor(animTicks / 7) % 4;
      char(addWithCharCode("a", ai === 3 ? 1 : ai), player.x, 30, {
        // @ts-ignore
        mirror: { x: player.vx },
      });
      remove(dots, (d) => {
        color(
          d.isPower && floor(animTicks / 7) % 2 === 0 ? "transparent" : "yellow"
        );
        const c = char(d.isPower ? "g" : "f", d.x, 30).isColliding.char;
        if (c.a || c.b || c.c) {
          if (d.isPower) {
            play("jump");
            if (enemy.eyeVx === 0) {
              powerTicks = 120;
            }
          } else {
            play("hit");
          }
          addScore(multiplier);
          return true;
        }
      });
      const evx =
        enemy.eyeVx !== 0
          ? enemy.eyeVx
          : (player.x > enemy.x ? 1 : -1) * (powerTicks > 0 ? -1 : 1);
      enemy.x = clamp(
        enemy.x +
          evx *
            (powerTicks > 0 ? 0.25 : enemy.eyeVx !== 0 ? 0.75 : 0.55) *
            difficulty,
        0,
        100
      );
      if ((enemy.eyeVx < 0 && enemy.x < 1) || (enemy.eyeVx > 0 && enemy.x > 99)) {
        enemy.eyeVx = 0;
      }
      color(
        powerTicks > 0
          ? powerTicks < 30 && powerTicks % 10 < 5
            ? "black"
            : "blue"
          : enemy.eyeVx !== 0
          ? "black"
          : "red"
      );
      const c = char(
        enemy.eyeVx !== 0 ? "h" : addWithCharCode("d", floor(animTicks / 7) % 2),
        enemy.x,
        30,
        {
          // @ts-ignore
          mirror: { x: evx },
        }
      ).isColliding.char;
      if (enemy.eyeVx === 0 && (c.a || c.b || c.c)) {
        if (powerTicks > 0) {
          play("powerUp");
          addScore(10 * multiplier, enemy.x, 30);
          enemy.eyeVx = player.x > 50 ? -1 : 1;
          powerTicks = 0;
          multiplier++;
        } else {
          play("explosion");
        }
      }
      powerTicks -= difficulty;
      if (dots.length === 0) {
        play("coin");
        addDots();
      }
    }

hoseja
4 replies
9h26m

Why would anyone even consider pasting obfuscated JS into their console, on HN of all places, is beyond me.

rane
2 replies
9h19m

Theoretically, what's the worst thing that could happen - given it's a pacman game's console and not your online bank's?

cangeroo
1 replies
9h12m

I recall manually entered commmands have access to some APIs that are not normally accessible. Maybe timing related? So in the theoretical extreme, a timing attack to access something in your entire system memory and upload it via HTTP... while you watch the game play :)

londons_explore
0 replies
3h32m

Do they? It's easy enough to 'give' any API accessible to the console to the page by setting a variable from the page to point to a console-only accessible function.

Given there aren't many sites that say "just open the console and paste this command to win the big prize", I suspect that any console-only API's aren't very powerful if they exist at all.

jessekv
0 replies
1h16m

No different than clicking on the links, right?

(Admittedly I typically browse with JS disabled...)

supriyo-biswas
0 replies
9h34m

This seems to make it possible for Pac-man to stick with the ghosts while still consuming pellets, so maybe still evading the rules of the game :)

svat
2 replies
12h8m

How did you (or how does one) discover that the game state consists of the variables enemy.{x,vx,eyeVx}, player.{x,vx}, powerTicks? (And are there others?)

mrb
0 replies
8h52m

I reverse-engineered it. This whole exercise took me about 30 minutes while half coding and half watching a TV show. Since the JS code was neither minified nor obfuscated, it was easy. Here are my exact steps:

In Chrome, right-click on the page -> View Source. Go to the "Sources" tab. When you open the tree on the left you find a file, that was dynamically loaded (so you wouldn't have found it by just looking at the HTML source of the main page), https://abagames.github.io/crisp-game-lib-11-games/pakupaku/... that seems to contain the game's code. And indeed it's less than 200 lines and implements the core game logic.

There is a main function, update(), containing a conditional "if (!ticks)" that seems to do initialization. "ticks" is probably zero at the start of the game. The code initializes multiple variables, including "player" and "enemy":

    if (!ticks) {
      player = { x: 40, vx: 1 };
      enemy = { x: 100, eyeVx: 0 };
      multiplier = 0;
      addDots();
      powerTicks = animTicks = 0;
    }
Then with a bunch of console.log() statements added to the update() function (just edit the code and type Ctrl-S to save it, Chrome allows this sort of in-place code editing), I got a sense that player.x and enemy.x was the x position, with the scale going from 0 (left edge) to 100 (right edge). Then with more console.log() statements I found enemy.eyeVx was normally 0 when the enemy is a ghost or 1 or -1 if the ghost has been eaten and its eyes are flying respectively right or left.

Some of the code is less readable, for example:

    if (enemy.eyeVx === 0 && (c.a || c.b || c.c)) {
      if (powerTicks > 0) {
        play("powerUp");
        addScore(10 * multiplier, enemy.x, 30);
        enemy.eyeVx = player.x > 50 ? -1 : 1;
        powerTicks = 0;
        multiplier++;
      } else {
        play("explosion");
        end();
      }
    }
I figured by literally typing "play(...)" in the dev console that these functions play a sound. Therefore based on the sound names "powerUp" and "explosion" I realized this code block is called when pac-man collides with a ghost. And either it has a power-up ("powerTicks > 0") or not, in which case it dies.

At this point I had the meaning of "player", "enemy" and "powerTicks" and that's all I needed to write the bot.

lifthrasiir
0 replies
11h24m

The source code for the page doesn't have any reference to a game-specific source code, so it must have been loaded dynamically and can be found from devtools [1]. You can then read the actual code and find that every state is in the global scope, so they are directly accessible without any trick. It hasn't been minimized so all variable names make sense and you can even guess their purposes without actually checking.

[1] https://abagames.github.io/crisp-game-lib-11-games/pakupaku/...

cdchn
2 replies
17h1m

Putting comments before the conditionals made my brain parser malfunction for a moment.

tanseydavid
1 replies
16h44m

Same here -- but I kind of like it. I might adopt that.

cdchn
0 replies
16h19m

I'm kind of a 'why not what' kind of guy when it comes to comments. For example "powerTicks < 10" took much less time for my brain to parse (and I get extra information, I see there is a variable called powerTicks then "/* ...has no powerup or powerup expires in less than 10 "ticks" */" did. Then my eyes had to scan for the closing comment to get to the important part.

Something different, but not for me personally.

AnotherGoodName
1 replies
16h11m

I simply changed the distance to be dynamic based on closeness to the edge and it's getting into the many 100's of thousands. This simple change also seemed to fix the edge case of the respawn hitting the player is solved since the player never gets into that magic position (the enemy has to be in a very specific position for the eyes to reach the end just as the player does).

    function bot() {
        /* direction of the enemy: to our right (1) or to our left (-1) */
        dir = (enemy.x > player.x) ? 1 : -1;
        nearWall = enemy.x < 10 || enemy.x > 90
        /* if pac-man... */
        if (
            (
            /* ...has no powerup or powerup expires in less than 10 "ticks" */ 
            powerTicks < 10 &&
            /* ...is headed toward enemy */ player.vx == dir &&
            /* ...is too close to enemy */ abs(player.x - enemy.x) 
            /* ...the distance before running away can be lower if we're near an edge */
                < (dir == 1 ? player.x / 7 : ((100 - player.x) / 7))+7 &&
            /* and if enemy's state is not "eyes flying back" */ 
            enemy.eyeVx == 0)
        ) {
            // "ArrowUp" or any arrow key reverses the direction of pac-man
            document.dispatchEvent(new KeyboardEvent('keydown', {code: 'ArrowUp'}));
            document.dispatchEvent(new KeyboardEvent('keyup', {code: 'ArrowUp'}));
        }
    }
    setInterval(bot, 10);

mrb
0 replies
9h18m

Of course ! Nice.

trevithick
0 replies
16h53m

This is really cool. My bot score stayed low because there was a single dot remaining near the middle which Pac-Man couldn't reach. They went back and forth for a long time until the ghost became fast enough to get him. Still fun to watch.

oleganza
0 replies
4h46m

This is great. That's what Alan Kay envisioned when doing Smalltalk 45 years ago: opening up a computer program while it's running and tinkering with its code directly.

And it's quite funny that JS was designed after Self/Smalltalk well before anyone cared about interactive tooling, towards which we evolved independently.

Alan Kay truly is a genius.

elijahbenizzy
0 replies
16h56m

This is true AI! Nice work!

jncfhnb
18 replies
22h13m

Nice game! I managed to 6,600 points

Per my experience The optimal strategy is to deprioritize eating the ghost. You can get some nice streaks sometimes eating him but it generally doesn’t help.

What you want to do is use the power up to collect the middle dots. The sides you can collect safely on reflexes alone. By about 3000 points it becomes impossible to recover if you don’t pick up the middle and have consumed your power up. Eating the ghost is ok if it happens incidentally.

Because you’re trying to use the power up to collect the middle that often means the ghost will be further from the middle than you when you finish a line. So finish a line, then 180 immediately to collect the middle again. The worst case is you end up with your power up ending just as you’re finishing a line and you are on the side. But up until very high point values I think it’s always safe to grab the power up as it tends to be on the sides.

Edit: 6800

Might play more if other HNers step up their game :)

auselen
4 replies
21h46m

Came here to say 520 (;・∀・)

nvy
2 replies
19h6m

Is the upside down A supposed to be a bird's beak?

jncfhnb
0 replies
17h58m

If you’re on iOS, add the Japanese keyboard and hit the lower left most key, then expand autocorrect to get a big array of such emoticons.

NooneAtAll3
0 replies
18h47m

it's a smile

russellbeattie
0 replies
21h27m

Heh. My first or second game, I just happened to get like 650 points. And then spent the next 20 minutes trying to figure out what the hell I had done. Turns out you can sometimes get into a rhythm where you don't even have to turn for a while and score a lot of points.

OP's score is just ludicrous.

j_maffe
2 replies
19h25m

11,800 with a multiplier of 40 ;D It's really all about the endgame knowing when how to manipulate the ghost's position. Sometimes it's worth it to wiggle back and forth until the ghost gets close to you in the middle to be able to get the dots on the edge. But yes once you pick up the power-up you need to pick up the middle dots.

sh4rks
1 replies
18h44m

25923. I'm going to bed now.

j_maffe
0 replies
6h28m

Ok I reached 19,098 and I think it'd take a lot of time to improve that. It gets too fast at level 50 for my mortal reaction-time.

xg15
1 replies
19h38m

Crazy enough, that strategy really works! Barely got to 1000 by eating ghosts and easily to 5000 using your strategy.

I'd say there is even a (very slight) disadvantage to killing the ghost: As long as it's on screen (and preferably slowed down) you know where it is. Once you kill it, you don't know exactly when and where it will reappear.

Interestingly, the points you get for a kill are NOT tied to how many ghosts you've killed before. They only depend on the speed of the ghost, which in turn depends on your overall score.

So I think one addition to the strategy would be to try to keep the ghosts alive as long as practical early on, then start hunting them when you have, say, 1500+ points and kills can actually give a significant bonus.

jncfhnb
0 replies
18h35m

The ghost always goes to the further side and spawns as soon as it reaches the end

mproud
1 replies
11h14m

Yes, I figured this out too. Not eating the ghost is the right play.

rkagerer
0 replies
9h11m

Ghosts, betcha can't eat just one.

jncfhnb
1 replies
18h2m

I have now had several games in the 17000s range although I see I’m not the top scorer here anymore. I don’t think I can go any faster without getting to a physical keyboard vs my touch screen!

A couple more notes: I see now that the score multiplier goes up by 1 for every row cleared AND for every ghost eaten. I don’t think this changes much about my recommended strategy except sometimes you can pause or delay to set up a free ghost kill without breaking the originally stated strat and it’s worthwhile to do so.

At very high levels (15000+) I’m finding it necessary to double tap rapidly to induce small pauses to let the ghost catch up. The timing of these pauses is very tough at high speeds. But the gameplay feels almost safer and more formulaic. Not sure if that’s a function of anything changing in particular. It might just be the normal Strat but fast enough that it normalizes. I might try to do this on a keyboard to get them frame perfect pauses going lol

Edit: worth noting my high score went from 7k to 16k in one game without realizing it had been a particularly good game. The scores ramp up very quick late game and it’s not quite as huge of a gap as you might think

DevDesmond
0 replies
1h55m

High score: 50060

The biggest part of my strategy is to do a lot of stutter steps/dash dancing to try and collect the power up as close to the ghost as possible. Doing so is more likely to lead to a sort of "combo" state where your pacman can spawn kill the ghosts without any additional input. Fast reflexes can keep your combo state going if you know when to stutter step and when to turn back around and start comboing again in the opposite direction Getting your game state into such a combo state is even stronger in the late game as your pacman moves so fast it can almost always set up for a lot of safe kills quickly. And additionally, as you pointed out, by getting a ghost kill for every power up you get, you hasten the speed at which you grow your multiplier

sh4rks
0 replies
19h21m

Okay, after 30 mins of attempts, I managed to get 8600. I could probably go higher if I tried.

progmetaldev
0 replies
20h23m

YES! I play this way even with the original version on Atari, as well as all of the various other 8-bit versions (Ms. Pac Man, Super Pac Man, Pac Man Jr., etc.)

nonethewiser
0 replies
17h58m

I suppose the score limit is infinite if you never die to the ghost so that seems like a good strategy.

goldemerald
0 replies
21h15m

Mostly following your advice, I got 14257. I found if I could easily eat the ghost, it was worth taking a few extra steps to go for it. The real key is knowing you can successfully leave 6 on either side to carefully pick up after getting the middle.

bagels
13 replies
22h36m

Controls would be better if left arrow went left, and right arrow went right. As is, they both toggle, which can lead to wrong inputs when trying to stall (left/right in succession)

pesfandiar
3 replies
21h39m
jader201
2 replies
20h13m

That may make sense for some games, but for a game that has two directions, it makes less sense.

Probably better to completely disable the arrow keys -- or better, limit it to the spacebar -- to reinforce single-button design.

Or, just intuitively support left & right.

probotect0r
1 replies
19h32m

On mobile, it works really well because all u have to do is tap to change the direction. They should just remove the arrow keys on web, as you said.

bagels
0 replies
14h3m

Or, better, make them function as is the norm for every other game.

throitallaway
0 replies
22h3m

As a button masher (go left, go left!) this is infuriating.

stavros
0 replies
21h45m

I tried to find the source so I could change this, but it doesn't seem to be in the samples dir, at least not by that name.

spinach
0 replies
17h42m

It seems like all the buttons on the keyboard can be used to tap and are toggles.

oaktowner
0 replies
20h41m

I had to start using the space bar instead of the arrows -- it reinforced in my mind that it was a single-button controller.

max23_
0 replies
14h25m

Yea. Automatically used left/right for the movement, only then realized it is 1 tap.

hrldcpr
0 replies
19h26m

Just use the spacebar, or really any key other than arrows.

hinkley
0 replies
22h32m

I was trying to figure out why I despise the controls. I think you are right. The first time I hit left it did something, the second time it ignored me.

fabiensanglard
0 replies
21h40m

Yup, that was frustrating!

FpUser
0 replies
21h53m

Same here

prhn
9 replies
22h35m

Wow, that's fun. I wish I could articulate why the music and dying sound effect are both so great. The gameplay has a great rhythmic feeling to it. It's also really tense. I scream every time that damn ghost catches me.

The best part is when I die I feel like I made a dumb mistake, and that if I improved just a few things I could be way better.

Too many games these days give you the allure of depth and complexity by making things difficult in the wrong ways.

PaulHoule
2 replies
22h30m

It's pretty, I'll give it that.

I don't feel like it was my mistake when I got killed often, for one thing the ghost is faster than me, sometimes respawns right next to me, ...

prhn
1 replies
22h11m

Isn't the ghost spawn at least somewhat predictable?

I think it picks the farthest edge from where you ate it. Also, it only spawns at the edges, so don't eat the ghost near the edge if you're not sure where it will spawn.

Yes the ghost is faster than you, but it can't wrap around the stage like you can.

brianpan
0 replies
20h32m

You just need to use your eyes. ;D

glhaynes
1 replies
21h0m

The best part is when I die I feel like I made a dumb mistake, and that if I improved just a few things I could be way better.

I think I've heard Miyamoto talk about that. When the frustration is all with yourself (rather than with the game itself), and you just know that if you try one more time, that'll be the one where you won't make any dumb mistakes. I think it's the cornerstone of every action game that appeals to me.

IggleSniggle
0 replies
14h8m

Also the cornerstone of every strategy game that appeals to me.

filoleg
1 replies
19h58m

There is something to be said about “easy to learn difficult to master” curve, as well as overall basic simplicity and the feedback loop being very transparently clear and “tactile.”

The one game that never fails to hook me in that way is Quake 3. Every mistake feels like your own, but with a very clear and obvious path for improvement. Every improvement step feels incremental and doable, none of that “noscope 180 from the bushes where i had zero chance to spot the enemy” situations.

Even on kills where it initially felt like some annoying cheap trick, i watch the killcam, and walk away very impressed and eager to try out their approach myself. And it always makes perfect sense. As opposed to a lot of more modern games, where killcam only frustrates me more.

Imo this is the same thing that made the original DOOM a massive sensation, but I feel like Quake 3 would be easier to relate to for a lot of people (on HN or elsewhere). At the time, I was too young and growing up in a wrong part of the world to catch that original DOOM hype. But with Quake 3 (and imo even quake 1 and 2), that phenomenon truly transcended countries and cultures.

boredemployee
0 replies
14h47m

Quake takes a lifetime to master

philmcc
0 replies
12h12m

I think you're appreciating (what I also appreciate) that the chomp, ghost bite sound, and death sounds are all in the same tempo/bpm, so that when things happen it's in "rhythm"

If you look closely, the chomping visual doesn't -actually- match up with the chomp sound, it's closer to if there was a track of chomping at a certain chomps per minute that gets toggled on/off if pacman is chomping. Same with everything else-is, so you mute/unmute sounds when the event happens, rather than trigger a sound play.

Or so it sounds and seems to my ears and eyes.

gerdesj
0 replies
16h58m

It sounds like you need to experience eight bit computing! My Commodore 64 from 1986ish still lives after a re-capping a few years ago. I grew up with Sinclair ZX80, 81 and Speccy too.

Nowadays we have such capable hardware that we can model near photorealistic stuff in real time. Not quite but not far off.

Those manic sounds and graphical effects are what you get when the hardware is very limited and some very talented people decide they want more, a lot more.

See if you can run up a simulator and get something like a Jeff Minter game running on whatever your IT gear is. You may like Attack of the Mutant Camels - the sounds are quite surreal, given the target hardware.

Consider taking a look at RetroPie or something similar.

OakNinja
9 replies
22h47m

Amazing game!

Is it possible to get a higher score than 29?

jebarker
2 replies
22h46m

Yep, I got 30 EDIT: 450 :)

GauntletWizard
1 replies
22h44m

I got 533; There's a bonus multiplier that builds the more times you eat the ghost (I think?)

jncfhnb
0 replies
22h0m

Pretty sure it’s based on rows cleared not ghost eats

skrebbel
0 replies
22h46m

Yes

jagged-chisel
0 replies
22h42m

701

eastbound
0 replies
22h36m

Yes, it does integer-overflow. I mean on the d axis, but on the points axis.

bru
0 replies
22h29m

816.

bagels
0 replies
22h45m

Yes, trivially.

aidos
0 replies
22h27m

1274, so yes.

samstave
7 replies
22h31m

WONDERFUL.

It better be landscape only on mobile. Add a pitfall bomb (what was that game that created a hole for the critters to fall into, and you could walk over them, but the climb out and the hole heals in a short period... ? Let the ghosts to fall in a hole, then you can place more than one ghost on the path, but you need as many "hole bombs" as there are ghosts on screen+1 (or N)... to not make it rage quit-worthy.

tremarley
4 replies
22h17m

Most people use their phone in portrait mode.

If it were Landscape Only, it would create unnecessary friction.

gojomo
2 replies
21h10m

Alternatively, the one dimension of movement could be up-down.

samstave
1 replies
20h44m

no. its a single tunnel. no off-shoots. 1D.

Cant turn. only damage the 1D path, to your advantage/detriment.

Your mechanic is Gauntlet. (best video game ever)

gojomo
0 replies
5h12m

Up-down instead of right-left would still be a "single tunnel", "no off-shoots", "1D", "can't turn", etc.

samstave
0 replies
21h49m

>>Most people use their phone in portrait mode

We have invented a new word for you to incorporate into your comments:

"OPTIONS"

jerf
1 replies
22h5m

"what was that game that created a hole for the critters to fall into, and you could walk over them, but the climb out and the hole heals in a short period..."

Lode Runner: https://www.youtube.com/watch?v=PWwyhymcDxI

spc476
0 replies
21h36m

You can even play it online: https://loderunnerwebgame.com/game/

thomastjeffery
5 replies
22h29m

It was hard until I realized that the ghost doesn't change when you cross the edge of the screen. After that, it turned into an uninteresting stalemate.

The controls really need to be edited, though. Left should be exclusively left, and right exclusively right. Having them both toggle makes input the primary challenge.

hnlmorg
2 replies
20h28m

I found the input really intuitive. Personally I preferred it to having invisible zones on the touch screen that react differently

thomastjeffery
1 replies
20h23m

I used a keyboard, not a touchscreen. I'm not sure if/how that is different.

hnlmorg
0 replies
16h37m

Fair point. I could see how that might be confusing if the arrow keys aren't mapped to what you would expect.

jncfhnb
1 replies
22h5m

Stalemate is a loss. The goal is to get points, not survive X seconds.

thomastjeffery
0 replies
20h43m

That's unfortunate, because it adds a second dimension to strategy.

rdoherty
4 replies
20h43m

This reminds me of the book Flatland which is about what a 2 dimensional universe would be like and the experience of a 3 dimensional entity visiting it. Great read! https://en.wikipedia.org/wiki/Flatland

neilv
2 replies
19h59m

I wonder whether anyone has done a Pac-Man variant inspired by Flatland.

Say, a powerup temporarily turns the screen to 3D, with the ghosts only perceiving the 2D slice. Pac-Man might be a cone that can 'shrink' to squeeze around ghosts, can jump through 3rd dimension to 'teleport', can move back and forth between different 'levels' floors in a building, etc.

vikingerik
0 replies
17h20m

It's not exactly Flatland or everything you describe, but there is an old arcade game named Pac-Mania where Pac can jump over the ghosts in 3D but they only move in 2D.

rdoherty
0 replies
17h35m

That would be really cool! Kinda like Super Paper Mario.

xtracto
0 replies
19h14m

Carl sagan has a good video on that :

https://m.youtube.com/watch?v=UnURElCzGc0

mrb
4 replies
21h26m

I have been looking for 1D game ideas to implement on an addressable RGB LED strip. 1D pacman seems perfect, as it's instantly recognizable even with a single-pixel pacman and ghosts, by using the right colors.

gojomo
2 replies
21h12m

Your comment reminded me…

Long ago – early 80s – UHF & cable-syndicated TV station WPIX (NY) offered live broadcast call-in videogames controlled by the caller's voice yelling "pixx!". Here's a peek of some of the forms it'd take:

https://www.youtube.com/watch?v=UJN9eM84Rq8

"Behind the scenes, the voice activation was really operators in the control room pushing the buttons." :)

The simple control of this 1D PAKU-PAKU game (or others you're considering) could be wholly voice-operated. (A fun trigger word nodding to an old 'Friends' episode might be: "Pivot!")

With modern voice-recognition/voice-printing, it might even be possible to have a multiplayer game where even though N players are all yelling the same trigger-word, the recognition disambiguates the speaker to control only their sprite. Or, use a larger vocabulary of control-words for more actions. 'Nibbler' with yelled commands "Up!"/"Down!"/"Left!"/"Right!" might be diabolically frustrating.

mrb
0 replies
20h20m

Very cool ! I like the idea of voice controls. Right now I have a 22-foot long LED strip on the fascia of my house. I was thinking of putting a physical button for visitors or random pedestrians to play the games, but voice control would be more fun.

gojomo
0 replies
20h53m

Another thought: have the 1D RGB strip spin around its long-axis to enable rapid LED cycling to stroboscopically plot the domain in 2D, despite the action & rendering array being "only 1D".

meta-level
0 replies
10h4m
darajava
3 replies
23h19m

So much fun! And well implemented. What did you use to build it?

philomath_mn
1 replies
22h43m

I am guessing it is a demo for this lib: https://github.com/abagames/crisp-game-lib

msephton
0 replies
17h36m

Not really a demo but one of the games he (Kenta Cho) has created using his own library. Imagine it as his yoga or meditation practice. The outlet for his creativity. The Crisp Gane Lib framework allows him to implement game ideas extremely quickly with little friction. Gameplay first!

noduerme
0 replies
22h41m

Looks like a custom-built game library they designed atop Pixijs

https://abagames.github.io/joys-of-small-game-development-en...

[edit] It seems that Pixi is one rendering method, and the graphics themselves are abstracted via a "terminal" and "view" class, so the engine focuses on positioning art rather than handling sprite draws directly.

It's a nice set of opinionated choices. In particular, implementing collisions for 2D sprites. I built a game engine like that with particles and collisions (and particle collisions!) in AS3 on top of Starling at one point... sadly, I can't make games with it anymore.

chupapimunyenyo
3 replies
18h10m

It's still 2D

amayne
1 replies
16h14m

If Pac-Man and the ghost positions are on the x axis, what is the y axis used for?

Chaosvex
0 replies
13h28m

It's a 2D game with one axis of movement. Technically correct and all that.

emehrkay
0 replies
13h14m

I was expecting the same game, but from paceman's pov. so you'd see a small line for the dot and a bigger line behind it for the ghost. After thinking about it, I think the game would function the exact same as the lined one, just a drastically different perspective.

wkjagt
2 replies
21h27m

This is wonderful. Very nice execution, and super addictive. I kind of want to do a Commodore 64 version now.

msephton
1 replies
17h16m

If you do it please consider porting Crisp Game Lib, the framework used to create this game, which will net you hundreds of new C64 games in one go.

quickthrower2
0 replies
7h36m

Can a C64 efficiently run JS?

saint11
2 replies
23h20m

It's really cool how they managed to make an interesting mechanic with such a big limitation

yreg
0 replies
20h10m

Imposing limitations is how you come to interesting mechanics.

msephton
0 replies
17h19m

It's true. And the creator has made many hundreds of games with this philosophy. All good!

mongol
2 replies
22h26m

Next Flappy Bird in my opinion

tremarley
0 replies
22h17m

Agreed

throw_m239339
0 replies
21h51m

LOL, exactly what I thought...

jonnycomputer
2 replies
16h51m

Almost completely broken on Firefox 121/Mac OS. I was wondering what the fuss was about because it was just a mess. But threw it up on chrome, and looks completely different...

Also there is a weird latency thing if you hold the direction key down and then switch to the other direction.

Liquid_Fire
1 replies
5h33m

Works perfectly for me on Firefox 121 on Mac OS (although maybe it was fixed after you commented?).

jonnycomputer
0 replies
3h6m

No, I don't think so. Here is a screenshot of what it looks like to me:

https://drive.google.com/file/d/1C35Wc8toNQ9RN6ylOZ_bK6IRUjb...

However, when I loaded it in a new firefox profile it worked fine. A little confused because I tried running it with dev tools loaded and cache disabled and I still had the problem, but I have to think that the problem has something to do with adblock/privacy badger and some stored data. But maybe disable cache doesn't apply to the local storage API.

jerf
2 replies
22h47m

Should be named ·--· ·- -·- ··- ·--· ·- -·- ··- . ("Paku paku" in morse, though I changed the characters to be more obviously plausibly one dimensional themselves so your favorite converter may not work.)

tremarley
1 replies
22h15m

Paku Paku seems too vague.

I clicked on this link because it says “1D PacMan”

It made me think “how can Pac-Man be 1D?”

jerf
0 replies
22h7m

I just copied it from the title screen. Actually I don't care what it's called, it should just be named with a 1-dimensional writing scheme.

brcmthrowaway
2 replies
20h42m

Is PacMan also in the public domain?

lotu
1 replies
20h36m

Nope, no video games are in the public domain nor will there be for decades. until the late 2060s :(

Dwedit
0 replies
20h27m

Except for games declared by their authors to be public domain.

thraxil
1 replies
21h43m

See also Line Wobbler by Robin Baumgarten: https://www.youtube.com/watch?v=9dufXuWDjLU

1D dungeon crawler hardware game.

KingMob
0 replies
9h3m

I've played it at Wonderville in NYC! It's surprisingly deep for such a minimal experience.

https://www.wobblylabs.com/line-wobbler

paulnpace
1 replies
17h55m

Better than the Atari 2600 version of Pac-Man.

JetSetIlly
0 replies
20m

Speaking of which, this 1D version would translate very well to the 2600

namuol
1 replies
14h53m

The game's designer/developer, Kenta Cho[1], has made countless experimental games for decades.

I'd nearly forgotten about his work until I saw this post, and I'm very happy to see that he hasn't stopped with experimental game design after all these years, and I have a huge backlog of games to play[2].

[1] https://en.wikipedia.org/wiki/ABA_Games

[2] http://www.asahi-net.or.jp/~cs8k-cyu/index.html

smusamashah
0 replies
2h31m

These are amazing. I use to play a space shooter game long time ago where you capture the incoming bullets by holding click and throw them back at correct angle. It was single button and mouse movement. Looking at these games, it feels like that one must have been by the same guy.

msephton
1 replies
17h33m

The developer of this game is Kenta Cho. He's been making games like this for 20+ years.

In 2021 he used his Crisp Game Lib to create 111 one button games! That's one every ~3 days.

For me, he's the greatest active game designer in the world today.

turblety
0 replies
10h34m
lanewinfield
1 replies
22h14m

People who liked 1D Pac-Man also liked Wolfenstein 1-D

https://en.wikipedia.org/wiki/Wolfenstein_1-D

yreg
0 replies
20h11m

Apparently here, but I don't know how to get past the menu.

https://archive.org/details/wolfenstein-1-d

gchaincl
1 replies
20h0m

It seems that perfection is attained, not when there is nothing more to add, but when there is nothing more to take away.

hoosieree
0 replies
17h48m

Tired of 0d pacman? Try -1d pacman!

PeterHolzwarth
1 replies
20h7m

https://en.wikipedia.org/wiki/ABA_Games

Oh, I had completely forgotten about aba games (the work of Kenta Cho) for some years until seeing this HN post! He has been making little mini-games and posting them on his site (both browser-based and windows-based) for more than 20 years now.

Here's his games (I always liked Torus Trooper): https://www.asahi-net.or.jp/~cs8k-cyu/index.html

IggleSniggle
0 replies
13h56m

Holy cow. Tumiki Fighters was one of my favorite games a long long time ago. I remember there "only" being 3 or 5 games though! Even then I thought this was brilliant work

veganjay
0 replies
21h30m

Love it! I like seeing Pac-man put into strange scenarios.

I made a slightly similar (1.5d?) game for the CHIP-8. Pacman can only go left and right, but the ghosts fall from the sky.

https://veganjay.itch.io/falling-ghosts

ugh123
0 replies
17h58m

LOVE IT! Could even be 'multi player' with someone else controlling the ghosts

tremarley
0 replies
22h14m

‘1D Pac-Man’ is a great name.

It made me click on this link because it made me think “how can Pac-Man be 1D?”

tempestn
0 replies
18h0m

Surprisingly fun.

stephenhandley
0 replies
21h44m

Love this, mechanics and music are great!

One suggestion would be to not care what key is pressed, maybe just have any key change direction?

snshn
0 replies
21h59m

Genius

sbisson
0 replies
22h47m

Someone has read the impossible game sections of Iain Banks’ Walking On Glass…

sakesun
0 replies
17h32m

Refreshingly simple, yet incredibly fun and engaging. Truly genius.

Building this game could be a very good programming excercise as well.

runnr_az
0 replies
22h50m

Clever!

roughly
0 replies
22h54m

That's more fun than I expected it to be! I like all the little subtle choices - how the ghost respawns, the speed of the ghost vs pac-man, the time it takes for the ghost to flash. It's simple, but I could feel myself learning the timing as I played and working through the strategy, such as it was.

readyplayernull
0 replies
21h2m

Good game. I also played 3D Pacman in DOS in an IBM PS1, this was years before Wolfenstein and Doom. Today we have come full circle!

https://m.youtube.com/watch?v=ajWIYW-wk6U

quickthrower2
0 replies
10h54m

Now someone do hyperbolic pacman!

quickthrower2
0 replies
18h44m

Brutally small amount of time as ghosts.

qkhhly
0 replies
20h46m

this is surprisingly engaging!

pkdpic
0 replies
16h3m

Absolutely fantastic, please make a version for Playdate or gameboy DMG and put it on itch.io for $10-$100 so I can give you money for this case study in gameplay perfection.

It's so beautiful and inspiring that one lone coder can still make something with so much joy and playability in an era of multimillion dollar games that take the work of hundreds of people for years on end.

This is a tribute to humanity itself, well done.

pcwelder
0 replies
21h19m

Kudos for building this. Highly rewarding and elegant. Initally I thought 200 was good. Ended up on 11k after half an hour or so.

pants2
0 replies
18h33m

In college I made a 1D space invaders game - but it ran on an Arduino (with one physical 'shoot' button) and was played on an 8foot RGB LED light strip. I had it mounted on a wall and I would catch students and professors playing it from time to time during the quarter. It was surprisingly fun.

This pac man game would be awesome to play on an LED strip as well!

nonfungibleuser
0 replies
19h56m

is there a leaderboard? I just got 69,420 points

nivertech
0 replies
9h46m

Artifcial constraints/trade-offs creating new unexpected properties.

Examples:

- up to 21 million Bitcoins limit - Artificial scarcity

- original 140 character limit for tweets, later expanded to 280, then removed for paid users

- up to 500 users per group in WeChat groupchat

- ip· o· gram. ˈlipəˌgram, ˈlī- : a writing composed of words not having a certain letter (as the Odyssey of Tryphiodorus which had no alpha in the first book, no beta in the second, and so on)

- wireframes vs realistic prototypes (low-fidelity vs high-fildelity)

- monochrome UI for smartphones to remove distractions

- feature phones vs smartphones

- 1D Pac-Man

- etc.

menzoic
0 replies
19h34m

Thought it was a joke at first, then I realized it’s viable

megalottachoc
0 replies
17h11m

And just like that, I can kiss my productivity goodbye for the rest of the day.

Sent from my cheap-arse $99 Android phone.

kqr
0 replies
7h49m

I wonder if this would be more intuitive if the playing field was a circular arc rather than a wrapping line.

justinl33
0 replies
22h10m

This is so fun! Makes me feel like I’m conducting a 1 dimensional random walk. Who knows, maybe this is being used to generate pseudo stock prices or something.

justinl33
0 replies
16h13m

I find playing this super ironic having just read this HN post about A* pathfinding tricks in video games https://news.ycombinator.com/item?id=38833658

jmclnx
0 replies
15h44m

That is so cool and fun!

jmartrican
0 replies
17h40m

This game is so much fun. Amazing.

jiveturkey
0 replies
22h27m

fun! for a fleeting moment anyway.

jader201
0 replies
2h34m

I don’t know if anyone else noticed, and I’m not sure whether this is intentional, or maybe the dev found it too hard to do well in browser-based games, but it seems like most of his games don’t sync the sound with actions happening in the game.

For example, in Pac Man, the dots chomping sound seems like it’s just a repeating sound that is toggled on and off, vs. actually syncing with the timing of chomping the dots.

Also, if you check out his other web-based games [1], you’ll notice the same thing — the actions (by tapping) cause a sound that is just repeated at a pre-set rhythm that doesn’t sync with when you tap.

It’s subtle, but can actually have an adverse affect on the performance of the game. I often use sound feedback as a way of timing, and when this doesn’t match what I’m doing, it can definitely throw me off my rhythm.

The Timber Test game [2] is a perfect example of this, particularly on the later levels where you need to cut the log into equal fractions, but the sound timing is always the same, making beeps in unequal intervals.

[1] https://www.asahi-net.or.jp/~cs8k-cyu/browser.html

[2] https://abagames.github.io/crisp-game-lib-11-games/?timberte...

j2kun
0 replies
20h55m

Nice. Now do it on a Mobius band: there's a "ceiling" and "floor", and when you go out the left, you end up on the ceiling on the right, and vice versa. Two ghosts chasing you, one on the ceiling and one on the floor.

indigodaddy
0 replies
18h47m

This is rather brilliant, congratulations

havkom
0 replies
20h59m

Brilliant game!

gooseyard
0 replies
15h38m

I haven't been this angry since QWOP, gold star

evolve2k
0 replies
22h29m

Yeah that was fun. Reminds me of 1D Doom that was shared here a while back.

eachro
0 replies
20h36m

That was surprisingly fun. Nice job!

dusted
0 replies
11h36m

not as "1D" as I'd imagined, but much more fun. I'm still toying with the idea of making a game that "renders" a 1D projection of a 2D space. (yes, I know, the line would be infinitely thin, I'll compromise on that by stretching it vertically so it's visible)

dukeofdoom
0 replies
17h47m

Do 1D Chess next

deadbabe
0 replies
19h17m

Would it still be 1D if there was a spot on the wall where you could step through and rotate to a tunnel on another 1D plane?

dbg31415
0 replies
16h36m

Bugs…

Ghost spawns to never be on a player. It’s not fair.

The big dots should give X seconds of ghost eating ability, not just make the existing ghosts edible. That way new ghosts that spawn instantly after you eat a big dot wouldn’t hurt you.

cush
0 replies
18h11m

This is way more fun than it should be.

block_dagger
0 replies
8h46m

That’s 2D

aziaziazi
0 replies
5h24m

I get a free ~50% slowdown (constant and consistant lag) if playing with low power mode activated (iOS/safari).

aungko
0 replies
30m

30000

asmmoto
0 replies
5h38m

Can you write the 3d version of it?

anilakar
0 replies
10h19m

Hangs latest Firefox developer edition, could not get past the loading(?) screen.

TuringNYC
0 replies
21h42m
SnoweKari
0 replies
7h30m

mrb's venture into the world of 1D Pac-Man with an auto-playing bot is a neat twist on a classic, complete with shared JavaScript code for all to tweak. Then AnotherGoodName steps in, tweaking the bot to dodge those pesky edge-case issues, skyrocketing the score into six digits. mrb's response to this upgrade? A cool 'Of course! Nice.' - a nod to the joys of collaborative coding and the magic that happens when minds meld over games and code.

SnoweKari
0 replies
7h6m

I'm loving this thread about the 1D Pac-Man bot. mrb starts with a great concept and then AnotherGoodName comes in and boosts its performance. It's like a mini hackathon in here!

Snawoot
0 replies
9h31m

No waka-waka - no fun.

MrYellowP
0 replies
8h11m

The noise is a serious dealbreaker. If it wasn't for that horrible noise, I'd still be playing. which is weird, but I really like the game.

KingOfCoders
0 replies
10h0m

What a genius game!

KingOfCoders
0 replies
9h57m

Somehow this reminds me of the Kung Fu Master arcade, which in this sense wasx also 1D.

Jesstannon
0 replies
7h20m

Diving into mrb's 1D Pac-Man bot adventure is like stepping into a coder's dream, complete with a shareable JavaScript code that's ripe for tinkering. Along comes AnotherGoodName, who cleverly tweaks the code, turning a good run into an epic high-scoring saga by solving those tricky edge cases. mrb's reaction, a simple 'Of course! Nice.', captures the essence of community-driven coding - where one good idea sparks another, and everyone's game levels up!

EugeneTays
0 replies
7h26m

mrb's journey into automating 1D Pac-Man turns a nostalgic game into a coder's playground, sharing their JavaScript bot that impressively scored 9,000 points on its maiden run. Enter AnotherGoodName, who amps up the game by fine-tuning the bot's edge strategy, blasting the score through the roof. mrb's reaction to this ingenious tweak? A simple yet appreciative 'Of course! Nice.', showcasing the spirit of collaboration and innovation in the programming community.

Dwedit
0 replies
20h29m

Took me a while to realize that it treats a (potentially repeating) key press as the condition to turn around, which badly messes with you if you assume the game has direct control.

DaveSapien
0 replies
7h38m

This was way more fun than it should be. Wonderful! Reminds me of Linelight on Steam and my game Kanso, both have 1D game mechanics (but with 2D visuals).

Darth_Guappi
0 replies
2h2m

This has NO business being this fun, you sunnofabitch!

BD103
0 replies
22h35m

Another interesting thing by the same person that got pretty popular on HN:

The Joys of Small Game Development https://news.ycombinator.com/item?id=37799387

AIboxed
0 replies
7h3m

The evolution of mrb's Pac-Man bot through community input, especially AnotherGoodName's contribution, is a perfect example of the power of collective brainstorming in tech. It's like watching a good idea become great through teamwork!