
Share Your Code
Browse Code
- All (911)
-
(94)
-
(86)
-
(44)
-
(4)
-
(42)
-
(137)
-
(22)
-
(41)
-
(13)
-
(65)
-
(152)
-
(211)
Air Hockey 2 Player Game
Air Hockey is a two player game designed to show off some of the physics engine properties of Corona SDK and how with a few lines of code you can write a very addictive game. First one to score five points wins. Works seamlessly across iOS and Android devices.
Open sourced MIT Licensed. Feel free to use the code as you wish. If you decide you want to make changes or additions, feel free to do so and let us know to share with our community.

- Type:
Replies
how do you set play against Computer mode? im not a programmer... only language I know is HTML and Somewhat PHP
It's supposed to be like that. Play any air hockey game and those are the rules. You can't cross the centre line with your paddle :)
Hi,
I tried this sample source. It works very well when i drag first time.
But it show some of error when i touch again to drag.
-- error message.
gameUI.lua:81: attempt to call method 'removeSelf' (a nil value)
stack traceback:
i didn't' change any code. Can anyone help me!
It is version problem. It works on Version 2011.632 very well.
^^
Hello,
Congratulations for the game. It is very nice.
One suggestion: how about AI for a new Player vs Computer version!?
Thanks,
Leonardo Opitz
Hey, I was working on the modified version of the game as suggested by Leonardo,, can someone please help me with the AI part?
How to get the computer to compute the best path to get to the ball?
Thanks
Sush
PS- Plz try to answer ASAP
suh-weeeet!
The computer AI would be quite fun to code. In theory, you would need the computer to follow the y position of the puck, but with a randomness factor otherwise you would never win! The computer could return the puck and then remain stationary until the player returns in. That could trigger the computer to move its paddle.
I'd start off just making it follow the puck exactly (y pos) and then try and add "intelligence" (or lack of) to make it miss a few times. May have a go myself if other people want to share some code / ideas?
I'm new to programming and have a very basic question. Nod I just coy the entire code file into the text editor? I'm using text wrangler? Or do I need to store the images and sound son where else? Any help would be greatly appreciated.
i love this game, so simple but can keep you busy for hours!
it's even more fun than to play checkers
i wish i had it om my knew cell





How is it that the puck can pass through the center line and the paddles can't? Is is due to the collision filter?