Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

long pong

Name: Anonymous 2009-01-18 3:47

I just coded pong (you know the game with the two paddles and the ball) in JavaScript.

Why you ask?

Because I coded it specifically so that when the user stretches the window, the playing field also stretches.

Why you ask?

Because at work there is a guy who I share a cubicle with who has THREE MONITORS. So I plan to use his workstation to stretch the browser window across all three monitors and play long pong.

How cool is that?

Name: Anonymous 2009-01-18 8:08

>>29
>Why must each player use the same keys??
Yeah I basically meant it only for one player. Making it 2 players wouldn't be difficult.
>What about the score?
The score's just an afterthought. The whole thing's just a joke so the score doesn't matter. Moving the score wouldn't be difficult at all, just add style="left: 50%;" to the score div.
>Also there's some kind of fucked up inertia on the bats and they don't move straight away.
That's a defect in JavaScript. The key inputs have to come via a keyboard event, so I can't just poll the keyboard every loop. You have to tap the keyboard to move the paddles. Each tap of up or down will accelerate the paddle in that direction.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List