nitdgpos / airhockey Goto Github PK
View Code? Open in Web Editor NEWAir Hockey game created using pygame
Air Hockey game created using pygame
Make an executable that'll run the game without the need to open terminal.
It seems as if the Puck(circle) is colliding with a rectangle hence no component of Vertical Velocity is changing please assign it to me
Works with #15
Score of A: X
Score of B: Y
if X>Y:
Game Points= X*(X-Y)
if X=Y:
Extra round is played until X>Y or Y>X
Increase the radius of the puck
Use concentric circles for the paddle
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)
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
The goal width should be appropriate
Also, design and display the scoring system.
Refer to Air Hockey Wiki
The impact between the puck and red bar is not perfect, it looks as if the puck is not touching , rather passing through the red bar.
When reset the Puck sets off in only a specific direction based of who loses, it should be more random
Like the actual air hockey
Currently, the puck is a small square, make it a circle.
Difficulty level is directly proportional to the velocity of the puck.
Slow puck : Easy
Fast puck: Difficult
Like a paddle class for paddles so they are more visible better manageable and make the overall code more readable
Add full screen support for this game to make it more immerse .
I guess I can do that @Aniq55
img
to aux
(for auxiliary) and put the 1.wav
file inside itif 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
update the screen-shots with start-screen and the game screen-shots
Play a sound each time the puck hits the goal
There is some problem with the latest merge. I am not reverting it. Please code the fix to it ASAP.
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?
The Linux section under Run is invalid, also there are merge conflict comments in few headers.
At slow speeds we can observe that the collisions are imperfect and unnatural.
Instead of a question mark, the game's logo should appear on the taskbar.
Create a start game page, which says "Press Enter to start game" and then start game.
The ball should bounce off all walls, even the ones which are vertical.
Show "Air Hockey" when hovered over taskbar activity or window.
Make each game of three rounds and declare the winner at the end of the game
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
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
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.
#f7eda5 = rgb(247, 237, 165)
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:
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.