Giter Site home page Giter Site logo

pong-wars's Introduction

Pong Wars

It's the eternal battle between day and night, good and bad. Written in JavaScript with some HTML & CSS in one index.html. Feel free to reuse the code and create your own version.

preview.mov

Development

Run:

npx serve

Open up the link and you're ready to start.

Credits

I saw this first here, but it appears to be a much older idea. There's some more information on the history in the Hacknernews discussion.

The colors are based on the Mindful Palette by Alex Cristache.

Submitting PRs

I love getting feedback and PRs with improvements for this, but I also want to keep this simple and the code minimal. If you want to extend the game, feel free to create your own. If you found a way to improve the collision detection (or a better way to add some randomness), feel free to open a PR.

Links

Alternate version

If you've created an alternate version of Pong Wars and would like to share it, please feel free to create a pull request to add the link here.

The alternate versions are listed below in alphabetical order:

pong-wars's People

Contributors

agneszitte avatar alan-kuan avatar ask5 avatar bjoernschilberg avatar flash1293 avatar flikkr avatar frederik-jacques avatar hmak-dev avatar krefikk avatar makaveli2p avatar nodonisko avatar riktov avatar roar-morkore-hansen avatar rosskarchner avatar schlagmichdoch avatar ssteve avatar tanguy-platsec avatar thrust26 avatar tristanbob avatar vnglst avatar vocdex avatar xiujunma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pong-wars's Issues

At high speed, colision detection misses blocks

With a sufficiently fast velocity (easily obtained with long runtimes), balls will phase through blocks entirely.
I speculate that this happens when the velocity of the ball is greater than one block size per frame, but I haven't read the code to see how collision checks work.
Checking for blocks between the last position and the current position would help prevent such warping.

Replace day/night with yes/no

Replace day/night with yes/no and allow to put a query string as a title. Would result in the perfect link for no clear yes or no answer, the eternal battle. Possible titles: "Will we finish the project before the deadline?" "Will our client ever be happy with what we do?"

Speed varies

This might be intentional, but when the ball's direction vector is updated, it adds some randomness to both components, regardless of the ball's speed. Over time, this can result in some large speed differences, which in turn can result in very uneven distributions:

image
image

Sometimes ball punches tunnel

After some time, one ball can be on a quite shallow angle. If it then bounces on the right spot on a wall (probably just on the edge between 2 bricks), it starts to dig itself in quite far instead of bouncing off.

Tapping the screen should speed up time

When it starts out, it's a bit boring. I tried tapping and holding my screen to speed up the simulation.

You could even make the left side of the screen reverse time...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.