Air Hockey Arcade
--The zip file contains 4 .M files. They are "AHA_GUI.m", "AHA_gameplay.m", "AI.m" and "AI_advanced.m"
--AHA_GUI.m is the file that creates the GUI. When the user presses the [Start Game] button, the program will call AHA_gameplay.m to start the air hockey game, AHA_gameplay.m will in turn call AI.m or AI_advanced.m to control the computer's mallet.
--The player can change the winning number of points and select the difficulty of the computer's AI.
--The default frame rate is 120 Hz. You might wish to adjust the fps value in AHA_gameplay.m according to your computer system's processing speeds to acheive a smoother playing experience.
--The user's mallet is controlled by movement of the mouse cursor.
--The movement speeds of the "normal" and "difficult" AI's are actually identical. The "difficult" AI is more challenging because it is better at predicting and reacting to the puck's movements.
--Animation is played aftering scoring of each goal and at the beginning/ending of a game.
--The program is tested to work in Matlab R2006a and R2010a. (Thanks Oren!)
--The program uses handles extensively.
--It is suggested clear all workspace variables before running this game to have the most stable performance.
Cite As
Chi-Hang Kwan (2026). Air Hockey Arcade (https://se.mathworks.com/matlabcentral/fileexchange/39474-air-hockey-arcade), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
