Hacker News new | past | comments | ask | show | jobs | submit login
1D Pac-Man (abagames.github.io)
1790 points by memalign 4 months ago | hide | past | favorite | 229 comments



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.


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);


A shorter way to change the direction of the player is to use player.vx *= -1;


Of course ! Nice.


[flagged]


What's that supposed to mean? Playing the game for a few minutes is fun, then writing a bot gives you another bout of fun.


Seems fun to me.


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


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


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.


[flagged]


Compare https://www.ruf.rice.edu/~kemmer/Words/parsing.html

Parsing has been used to describe the human activity of puzzling out meaning from a string of symbols for longer than electronic computers have been around.


I think you may be confused about what the word "parse" means. Adding "brain" is a bit redundant, but understandable on a site dedicated to computers.


Yeah, I do not know why OP would imply that. The brain does actually parse. In terms of language processing, the term "parse" may refer to the mental process of syntactic analysis, in which case the brain analyzes the grammatical structure of a sentence to comprehend its meaning. Besides that, there is auditory parsing of sound patterns, along with visual parsing of visual scenes to recognize objects, shapes, and patterns.

Sure, the brain does not follow the same principles of formal grammars used in computer science, but I think the term "parsing" still applies.


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.


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?)


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.


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/...


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.


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)


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.


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.


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.


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?


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 :)


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


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.


You inspired me to spend the last two days to build my own bot[1]. The highest score[2] it reached is 300k but it is cannot consistently reach this score (the average score is around 50k). The algorithm is to reverse the player direction only if one of the following conditions is satisfied:

1) enemy is running away from player && power is about to expire && player is close to enemy.

2) player is getting too close to enemy's respawn point && player is too far from wall opposite to him && player has little or no power.

3) enemy is close to player (<20 units away) && the player and the enemy are facing each other.

A live preview of the algorithm in action is deployed on github[3].

[1]: https://github.com/creme332/pakupaku-ai

[2]: https://github.com/creme332/pakupaku-ai/blob/main/assets/hig...

[3]: https://creme332.github.io/pakupaku-ai/?pakupaku


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.


This is true AI! Nice work!


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 :)


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();
      }
    }


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


No different than clicking on the links, right?

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


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


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 :)


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.


Browsers now require you to manually type 'allow pasting':

https://developer.chrome.com/blog/new-in-devtools-120#self-x...


Because normies are extremely susceptible to things like "hack Facebook, see the PMs of any hot girl u want!111 just right-click and paste this into your browser console trust me bro"

As well as the usual engagement driving "challenges" like "Omg did you know there's no country starting with Z! Bet you can't think of one!" meanwhile comments are filled with "duuuuh Zanzibaaaar!" and post engagement is >>>>>>>>>>>>


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 :)


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 :)


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.


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


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


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


58764!

Only other observation has been that the common failure mode is screen wrapping while the ghost is fleeing but without enough time to kill him. Don’t do this. Just wait until he is chasing you to screen wrap.


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.


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.)


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.


25923. I'm going to bed now.


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.


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


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


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


Ghosts, betcha can't eat just one.


Came here to say 520 (;・∀・)


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.


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


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.


Sweat smile it is supposed to be…


it's a smile


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


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.


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.


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.


Quake takes a lifetime to master


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.


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


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, ...


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.


You just need to use your eyes. ;D


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.


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.


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.



Great music as well! you sold his craft for me!


And the music in all his Crisp Game Lib games is randomly generated!


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.


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


I reached over 110000 points by below code. We may can reach 50000 by average. Basic strategy is that player turns lately as possible so that enemy can't catch with a distance in a bit. However, this strategy has extremely weak point, that is if yellow feed remains in the center of screen, player can't reach forever.

I'm not so interested in this game already. But I think this can improve to close perfect, which player can infinitely escape from enemy, by considering "Offense" aspect, like player's invincible mode and enemy's escape mode.

function bot() { dir = enemy.x > player.x ? 1 : -1; const Xp = player.x; const Xe = enemy.x; const pvx = player.vx; const escaping = (Xp < Xe && pvx < 0) || (Xp > Xe && pvx > 0); const escD = Xp < Xe ? Xp : 100 - Xp; const Vp = player.vx * 0.5 * difficulty; const evx = enemy.eyeVx !== 0 ? enemy.eyeVx : (player.x > enemy.x ? 1 : -1) * (powerTicks > 0 ? -1 : 1); const Ve = evx * (powerTicks > 0 ? 0.25 : enemy.eyeVx !== 0 ? 0.75 : 0.55) * difficulty; const VRatio = abs(Ve / Vp) === 0.5 ? 1.1 : abs(Ve / Vp); console.log(VRatio); const minD = (VRatio - 1) * escD + 3 * (VRatio + 1) + difficulty; const D = abs(Xp - Xe); if (!escaping && D <= minD) { document.dispatchEvent(new KeyboardEvent("keydown", { code: "ArrowUp" })); document.dispatchEvent(new KeyboardEvent("keyup", { code: "ArrowUp" })); } } setInterval(bot, 10);


Oh my gosh. How you all paste codes normally? lol


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


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


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...


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

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


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

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


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)



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.


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.


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


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.


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


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


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.


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


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


Yup, that was frustrating!


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


Same here


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


Imposing limitations is how you come to interesting mechanics.


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


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.


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


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


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


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


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


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


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


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


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.


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.


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


Carl sagan has a good video on that :

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


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


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.


Can a C64 efficiently run JS?


Absolutely not. It can do a lot of things but any interpreted language is going to run at a snail's pace, especially not one designed specifically for the C64.

Each game really needs to be written in isolation in assembly to work round the limitations, e.g. some might need a sprite multiplexor, some might not.



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


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.


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.


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.


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.


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".



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.)


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?”


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.


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.


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

1D dungeon crawler hardware game.


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

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


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.


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!


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


It does not seem to work on my side. I get a blank canvas with 0 on top left and HI 0 on the top right. Everything else is blank. In developer tools I've noticed that one of the GET on the main.js script is returning 404 so maybe that is the problem?


Same here. It seems to be broken at the moment.


IMHO, needs an appropriate stack of single row of microfluidics display[0][1] instead of single crt row.

An appreciation of 'Alice in Wonderland' quantum decision making might help too.

----

[0] https://www.youtube.com/watch?v=ncfZWqPm7-4

[1] https://pubs.rsc.org/en/content/articlelanding/2019/lc/c9lc0...


Found another small bug...

When you eat a ghost, the dots under the ghost don't get eaten. So you skip over 1-2 dots at higher levels when eating a ghost. Then you have to go back to snag them.


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!


This is way more fun than it should be.


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.


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.


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.


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.


"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


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


Most people use their phone in portrait mode.

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


>>>Most people use their phone in portrait mode

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

"OPTIONS"


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


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)


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


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

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


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


This is rather brilliant, congratulations


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

Sent from my cheap-arse $99 Android phone.


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.


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


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.


My 12 year old son spend today making this game in Scratch, creating the graphics with Lego:

https://scratch.mit.edu/projects/946299317/


This game is so much fun. Amazing.


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


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


‘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?”


My 12 year old son remade this game today in Scratch using Lego:

https://scratch.mit.edu/projects/946299317/


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!


Pac-Man meet Flatland (https://en.wikipedia.org/wiki/Flatland)


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).


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.


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.


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?


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


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?


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)


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


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


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


Next Flappy Bird in my opinion


Agreed


LOL, exactly what I thought...


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


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


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!


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


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.


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


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!


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


This has NO business being this fun, you sunnofabitch!


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


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


Better than the Atari 2600 version of Pac-Man.


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


Surprisingly fun.


Brutally small amount of time as ghosts.


Can you write the 3d version of it?


That was surprisingly fun. Nice job!


Is PacMan also in the public domain?


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


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


Now someone do hyperbolic pacman!


fun! for a fleeting moment anyway.


Genius


That is so cool and fun!


Bruh, the ghost moves faster than you do! But this is a pretty cool idea, difficulty level spikes after the first screen though, especially if you waste the power pellet, then because the ghost moves as fast or faster it becomes impossible to goad it to either side enough that you can get the remaining pellets.


No waka-waka - no fun.


What a genius game!


Do 1D Chess next


Brilliant game!


sびゃぶbs


this is surprisingly engaging!


Amazing game!

Is it possible to get a higher score than 29?


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


Yep, I got 30 EDIT: 450 :)


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


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


1274, so yes.


816.


701


Yes


Yes, trivially.


30000


That’s 2D


Clever!


It's still 2D


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.


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


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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: