4.75

4.8 | 4 ratings Rate this file 146 downloads (last 30 days) File Size: 3.72 KB File ID: #14152

Breakout

by Per-Anders Ekstrom

 

03 Mar 2007 (Updated 16 Mar 2007)

Code covered by BSD License  

Pong-like arcade game, a.k.a. Arkanoid/Brickles

Download Now | Watch this File

File Information
Description

Breakout begins with five rows of bricks, each row a different color.
The color order from the bottom up is blue, cyan, green, green and red.
Using a single ball, the player must knock down as many bricks as possible by using the walls and/or the paddle below to ricochet the ball against the bricks and eliminate them. Blue bricks earn one point each, cyan bricks earn two points, green bricks earn three points, yellow bricks earn four and the top-level red bricks score five points each. To add to the challenge, the paddle shrinks to one-half its size after the ball has broken through the red row and hit the upper wall.
(adapted from Wikipedia)
 
Game Controls:
Paddle is controlled with mouse.
Nine speed levels, changed using num-keys: 1...9.
Sound effects are switched on/off using 'S'.
Game is paused either with mouse press or 'P'.
    
Example:
breakout % Start Main Breakout Interface

MATLAB release MATLAB 7.2 (R2006a)
Other requirements Only tested using R2006a, should work with earlier releases as well. Tested on Windows XP and OS X. Might be too computationally intense for older systems.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
06 Mar 2007 John D'Errico

Pretty good. If you do try this, use it with the figure window maximized. Otherwise if your mouse wanders out of the figure window, the paddle stops responding since it uses windowbuttonmotionfcn to follow the mouse. It also got a little testy for me a few times when the paddle would not respond quickly enough. This was probably related to the speed of my cpu though. Also, the number keys seemed not to have any effect on the speed when I tried them.

Tested using R2006b on OS X.

08 Mar 2007 Johnny Steen

Love this game!

15 Mar 2007 Joseph Kirk

Excellent game! I remember playing this on an Atari... once upon a time. :o) Well written. No bugs that I found.

However, I had problems with the mouse wandering out of the figure window as well, even if I maximized it, and it was often at critical times in the game... so I added a couple lines of code that made a huge difference:

 line 223: case 99 % Move Paddle
 line 224: ptr = get(0,'pointerlocation');
 line 225: pos = get(gcf,'position');
 line 226: set(0,'pointerlocation', [ptr(1) pos(2)+pos(4)/2]);

This puts the up/down pointer location right in the middle of the figure window so it doesn't wander to the top or bottom... (and pressing ALT -on a PC at least- will release the pointer when desired)

15 Mar 2007 Per-Anders Ekström

Great idea!
I will update the file with your new feature.

01 Jun 2007 Christophe Morell

Very nice game. I didn't found any bugs. The interface is very nice and easy to use. But the game could be excellent, if you add some bonus hidden in the bricks, like additional life, sticking bracket, bracket with missiles, larger brakers.
Very good work

26 Jul 2007 Mike Masson

Gameplay Bugs:
-If you catch the ball against the wall and press the paddle up against it, the game goes into an infinite loop of the ricochet sound and freezes; Then Matlab crashed when I closed it. I couldn't duplicate the effect when I tried though.
-It seems if you increase the angle and velocity of the ball and hit the space between two diagonal blocks the ball will go through the diagonal blocks and destroy all of the blocks in its current pathway until it returns to normal movement again. Note: I kind of like this, it makes the game go a bit quicker.

The game is very nice

Please login to add a comment or rating.
Updates
16 Mar 2007

New pointer control, by Joseph Kirk (jdkirk630@gmail.com)

Tag Activity for this File
Tag Applied By Date/Time
games Per-Anders Ekstrom 22 Oct 2008 09:02:41
breakout Per-Anders Ekstrom 22 Oct 2008 09:02:41
arkanoid Per-Anders Ekstrom 22 Oct 2008 09:02:41
brickles Per-Anders Ekstrom 22 Oct 2008 09:02:41
bricks Per-Anders Ekstrom 22 Oct 2008 09:02:41
atari Per-Anders Ekstrom 22 Oct 2008 09:02:41
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com