Multi
Multi
HTML5 PONG
Topic Started: Tuesday, 21. June 2011, 10:47 (715 Views)
Andrew
Member Avatar
ぼくたちがすべてはばか。
So I'm making a game of Pong. Right now you can click the canvas and the ball will move to where you clicked. Pretty simple what I have done so far.

http://pro-online.zxq.net/portfolio/ponged/index.html

I'll finish this over the course of the week.
Edited by Andrew, Wednesday, 22. June 2011, 15:53.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
Oracle
Member Avatar
Level 8
Wow that's awesome. XD I can't wait to play the actual game.
Visit my shop! Forum reviews, posting packages, recolors
Posted ImagePosted Image
Posted Image
Me!

Off
Profile
Quote
Top
 
Geoffrey
Member Avatar
It's a love story, baby just say yes
It messes up if you click too much, too quickly. :#
Consider this statement my permission to convert my themes to other platforms. Please link back to http://geoffreykoester.com. Be sure to rehost all theme images on the new platform as we do not know how long they will redirect. Also some boards hosting theme/skin images may not survive the move.

Posted Image

Other Sigs
Awards & Memories
Off
Profile
Quote
Top
 
Alam
Member Avatar
Level 6
It also tends to lag a bit because you have to move the ball so often (it looks like ~1 px at a time). I would suggest increasing the amount that the ball moves from each call of your recursive function.
Posted Image
Credit to Sarah for the signature. <3

Spoiler: click to toggle
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
I actually just used a slope formula and then simplified it to see how many pixels to move it by. I'll fix the lag thing later. Time to utilize animation frames.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
Okay the game demo is up. Just need to fix a couple of bugs and rework the physics of the game.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
Aidan
Member Avatar
Level 12
Nice improvements, though it still needs work (again). Haha, I can't wait for the final outcome. :D
Off
Profile
Quote
Top
 
Oracle
Member Avatar
Level 8
I don't like how you have to keep on pressing a button to go down and up. This is awesome though.
Visit my shop! Forum reviews, posting packages, recolors
Posted ImagePosted Image
Posted Image
Me!

Off
Profile
Quote
Top
 
jay00
Member Avatar
Level 2
Oracle
Thursday, 23. June 2011, 03:43
I don't like how you have to keep on pressing a button to go down and up. This is awesome though.
I have to agree. But this is great, especially because I'm not familiar with any HTML5... yet :) Great work Pro, keep it up!
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
The reason you have to keep doing so is because if two people hold down buttons at the same time then the person who was late won't move.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
Reid
Member Avatar
Es una trampa!
Pro
Thursday, 23. June 2011, 07:28
The reason you have to keep doing so is because if two people hold down buttons at the same time then the person who was late won't move.
Use an event loop. That'll solve your problem quite nicely.

I wrote up this example. Excuse the shoddy coding: http://jsfiddle.net/JLSaF/

Of course, you can use setTimeout to avoid setInterval problems, since this is going to be an intensive script, and you can reduce the spacing of the timeouts/intervals for a more fine-tuned control (I find 20ms to work exceedingly well, actually).
Reid
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
Reid
Thursday, 23. June 2011, 10:35
Pro
Thursday, 23. June 2011, 07:28
The reason you have to keep doing so is because if two people hold down buttons at the same time then the person who was late won't move.
Use an event loop. That'll solve your problem quite nicely.

I wrote up this example. Excuse the shoddy coding: http://jsfiddle.net/JLSaF/

Of course, you can use setTimeout to avoid setInterval problems, since this is going to be an intensive script, and you can reduce the spacing of the timeouts/intervals for a more fine-tuned control (I find 20ms to work exceedingly well, actually).
Thanks :) now I'm just trying to figure out why it speeds up so much after a few rounds.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
FallenShadow
No Avatar
The Stoner Artist
lol the paddles wouldn't move
www.FallnShadw.com
Personal and Professional Portfolio. Officially Open.
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
Try clicking the page and try again.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
Cody
Member Avatar
Winter is coming.
Very nice, although after one goal the ball starts to go ridiculously fast. :P
Posted Image
Posted Image
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
That's already a known issue. I'm working on fixing it.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
buyessay
No Avatar
Level 1
It is not clear how it works. And sometimes buggy
Off
Profile
Quote
Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Theme & Layout Display · Next Topic »

Welcome Guest [Log In] [Register]
Outline Live
Loading..
Loading..