Air Hockey Arcade

Fast-paced air hockey game with physics based gameplay and two AI difficulty levels.
1.4K Downloads
Updated 14 Dec 2012

View License

--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 (2024). Air Hockey Arcade (https://www.mathworks.com/matlabcentral/fileexchange/39474-air-hockey-arcade), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Video games in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0