-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make this into a 2-player game #5
base: main
Are you sure you want to change the base?
Conversation
This adds a paddle on each side. The ball will bounce off of the paddle as if the paddle were slightly convex (otherwise the paddles wouldn't be too useful.) Control the paddles with: - Player 1, Up: Q - Player 1, Down: A - Player 2, Up: P - Player 2, Down: L (There's no definition of victory yet, or points.)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
HI @notfed , thanks for the PR, I like the idea but I want to keep it simple. Feel free to create your own version though. I'll add a MIT license so you can do whatever you like with my code. |
I didn't expect a merge :) The code is pretty sloppy, I did it in <45mins. Just wanted to open a PR in case anyone else wanted to try it out |
https://github.com/vnglst/pong-wars/assets/77453174/1131402a-3db3-47d5-9bca-d597eb5a74c1 Edit: add preview gif |
Think the left hand paddle should be at x position 15 so that the front face is at x position 25, should stop ball getting stuck behind it. That way paddle position should match right hand one in that back face of paddle is 15 from the canvas edge. |
This adds a paddle on each side. The ball will
bounce off of the paddle as if the paddle were
slightly convex (otherwise the paddles wouldn't
be too useful.)
Control the paddles with:
(There's no definition of victory yet, or points.)