Live data from Hacker News

Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

labs.codecomputerlove.com

81–90 of 129 posts

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#82
It's interesting that the Flash version has a frame rate of 100 and a calculated size of 8000 by 9000 pixels, while the javascript version leaves these undefined. I have no idea what the performance implications these attributes have, as I have never seen either so high.

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#85
Firefox 3.6.12 on a Mac. For what it's worth: Interesting behavior on the left side, the ball occassionally sticks to the paddle and vibrates, travels up the paddle and then scores a point against itself. (This is not a set up for a punchline.) Also, both sides show some stuttering in the ball movement.

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#86
post #59

Gah. People please stop using Z as the default key for down (or whatever). If you can't detect my keyboard layout use keys that are the same on every keyboard, no matter the language, or provide an option to configure the keys. My Z (on a Slovenian keyboard) is where your Y is (on your English keyboard). This makes the game unplayable for me, since my "down" key is above my "up" key, which makes it almost impossible…

On my french keyboard, both sides are equally handicapped, because the M too isn't on the same line as on a US keyboard : utterly unplayable :)

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#87

This is depressing. It's 2010, and our computers have issues rendering Pong .

Granted, the ball is using more pixels to render itself than all the pixels available on an atari 2600, and it's going through 10 levels of abstraction layers rather than using assembly code to blit pixels directly to the framebuffer...

Framebuffer? There is no such thing in the 2600 (see "Atari_TIA" Wikipedia entry for details).

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#88
post #85

Firefox 3.6.12 on a Mac. For what it's worth: Interesting behavior on the left side, the ball occassionally sticks to the paddle and vibrates, travels up the paddle and then scores a point against itself. (This is not a set up for a punchline.) Also, both sides show some stuttering in the ball movement.

I wrote a simple pong game once for a CS class, and in my case a vibrating ball was caused by simply negating velocity on a collision rather than setting its sign. It's better to do something like this (using C pseudocode as that's my native language):

  if(collision) {
      switch(side_of_screen) {
          case LEFT:
              horiz_speed = abs(horiz_speed);
              break;
          case RIGHT:
              horiz_speed = -abs(horiz_speed);
              break;
          case TOP: // Positive Y is downward
              vert_speed = abs(vert_speed);
              break;
          case BOTTOM:
              vert_speed = -abs(vert_speed);
              break;
      }
  }

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#89
post #44

Earlier quoted context omitted.

Yeah in the old days it performed quite bad. Nowadays with the newer distro's like suse 11, (k)ubuntu and a couple of others I really havent found any more glitches than on any regular windows machine running flash..

I develop with flash regularly on my Linux machine (Ubuntu 10.something), and it's definitely a bear compared to windows. I'll be happy for the day I can walk away from flash, but it makes computationally intensive consumer applications much easier/feasible. When we started out project almost three years ago, it was such a clear winner over JS, but now it's becoming a wash.

64-bit Linux is even worse, as it has to go through a 32-bit adapter to work in 64-bit Firefox. Video is unwatchable for me on a Core i7 with a fast video card.

Re: Pong written in both flash and HTML5. Left side is flash, right side is HTML5.

#90
post #50
post #45

Running Gentoo with Firefox 3.6.9 on a Core i7, HTML 5 is much more noticeably laggy while Flash (10.2.161.23) is perfectly smooth. In Chrome they're more or less equivalent. (Firefox's sluggishness could have something to do with many Firefox addons and having over 100 tabs open.)

are you sure its the flash that is smooth? I got have the same firefox on osx, and flash is laggy compared to the smooth js version. Flash is left, remember?

Chromium on ubuntu 10.04 -- flash stutters on the left-hand side, canvas smooth.

Of course, flash on chromium on ubuntu isn't what Adobe is optimizing for ... but that's just another reason to hope that canvas continues to do well.

Post reply on HN