Live data from Hacker News

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

killedbyapixel.github.io

1–10 of 51 posts

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

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

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

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

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

#9
> Do not move off the left or right side

Turns out if you do this, then hold the up key, it would appear that you avoid collision detection. Also, it appears your X position is preserved between levels, allowing you to hold the up arrow to rapidly advance levels.

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

#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.
Post reply on HN