Live data from Hacker News

Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

killedbyapixel.github.io

11–20 of 51 posts

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#11
post #10

I like this, except I'm really not a fan of needing to rapidly tap a key to move repeatedly in one direction. I don't know how many shortcuts were needed to get to 256 bytes, but I think the game would benefit from significantly shorter key repeat.

The repeat delay is actually controlled by your OS here because it's just a simple onkeydown event. Implementing movement rate would require far more code because you need up and down listeners and a state.

[deleted]

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#12
post #8
post #5

In Firefox, I'm getting ~500ms GC pauses every few seconds which make it pretty difficult to play. It works fine in Chromium, though. Edit: Firefox 122.0 on aarch64 (fedora asahi)

From the source the only thing I can see that would make garbage is b.innerText=o which is set 50 times each frame. But even then it's just one giant text node, not html elements so it's surprising this is causing so much GC in Firefox.

Looks like a job for the new profiler.firefox.com

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#13

Pretty cute, and it gets super fast pretty quickly. I got to level six on the first go, but after that I noticed if you move one pixel off the side of the screen you could just hold down "UP" to advance levels every few seconds.

If you're patient, you can just hold 'up' anywhere and it will eventually clear the level. It started taking quite awhile at level 20 or so - I got bored and gave up.

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#14
Very fun for 256 bytes. The script itself looks beautifully compressed as well. I think gameplay is a bit dampened by the scale of the board vs your character though. In Frogger (at least the one I remember) the cars are the same size as the player. Here they are double height which quickly turns it into a game of trying to tap as fast as possible even when you're only trying to pass one oncoming car a few levels in.

One thing I don't understand is the role of the "" closing tag. I didn't immediately see any reference to an open or closing svg tag anywhere in the source.

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#15
post #5

In Firefox, I'm getting ~500ms GC pauses every few seconds which make it pretty difficult to play. It works fine in Chromium, though. Edit: Firefox 122.0 on aarch64 (fedora asahi)

Actually I'm using Chrome and I also got some random lag spikes

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#17

Very fun for 256 bytes. The script itself looks beautifully compressed as well. I think gameplay is a bit dampened by the scale of the board vs your character though. In Frogger (at least the one I remember) the cars are the same size as the player. Here they are double height which quickly turns it into a game of trying to tap as fast as possible even when you're only trying to pass one oncoming car a few levels in.…

And now it can be 250 bytes.

Re: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS

#18
I also had performance issues in Firefox, so I tried something else: just holding the up key. It was surprisingly effective. Not that it didn't fail a lot, but it progressed through the levels at a fairly even pace.

Unless I misunderstand the maths, the hold-up strategy has the same probability of winning regardless of which level one is at, since the levels only increase the speed of the obstacles and not their density. I would have thought the difficulty would ramp up such that even stupid strategies get less effective at higher levels, but not this time!

Post reply on HN