Giter Site home page Giter Site logo

airhockey's People

Contributors

aniq55 avatar arpitmisraw avatar captaindavinci avatar jumbo94-cyber avatar lasers67 avatar nityanandagohain avatar shikhakujur avatar soumam007 avatar thealphadollar avatar vchrombie avatar vineetjc avatar zer-0-ne 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airhockey's Issues

Error when puck enters a goal

Traceback (most recent call last):
  File "main.py", line 161, in <module>
    gameLoop(7)
  File "main.py", line 125, in gameLoop
    puck.reset()
TypeError: reset() takes exactly 2 arguments (1 given)

Impact issues when puck and paddle, both are moving

It seems that often puck passes the paddle when both are moving in x direction, also as per law of physics in this scenario the impact must not just reverse the velocity of the puck but also add a component of paddleVelocity to it

Directory changes

  • Rename img to aux (for auxiliary) and put the 1.wav file inside it
  • Make the necessary changes in the README and python files

Using time limit for each round

if there will be three rounds ,use constant time limit for each round, because :--
1> global best points will remain open ended,hence can be updated with the score
2> I gotta think of more reasons

I can work on this even @Aniq55

Refactoring

Hello, I was going through the code base and found few places where I think we can re-factor the code to make it more readable and reusable. I would like to work on refactoring, but this might cause problems with the ongoing projects, should I go for refactoring?

Fix Readme

The Linux section under Run is invalid, also there are merge conflict comments in few headers.

Bounce off walls

The ball should bounce off all walls, even the ones which are vertical.

Bot vs Human match

Develop AI for Bot vs Human match. The Bot should be nearly impossible.
Better to use a variable reflex delay and speed the values of which will change the difficulty level of the match. High reflex delay and Low speed : Easy and Low reflex delay and High speed: Difficult

Add friction to the puck

Frictional Force = -B.v , where B is the friction coefficient and v is the velocity vector
Assume suitable mass (m) of the puck and apply deceleration in the direction opposite to velocity vector:
deceleration = -B.v/m

Add function to serve the puck

Whenever a goal happens, the player who loses should be able to decide the position of the puck and then hit it according to himself.

Introducing power-ups in the game

Power-ups appear in the game at random timings, the player has to touch it with their paddle to activate it. Some possible features are:

  • Bonus points
  • Slowing the puck on their side for 5 seconds
  • decreasing the size of the goal in their area
  • increasing the length of the paddle

The power-ups may also appear non-randomly, based on the performance of the player. suppose, consecutive 3 goals by one player shows a power-up.

Error while starting game

I am getting this error while starting the game

File "Air_hockey.py", line 101, in <module>
    pygame.draw.circle(screen, (255,255,255), (puck.x, puck.y), (puck.width/2))
TypeError: integer argument expected, got float

Refers to line 101. You should probably typecast it to an integer.

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.