File Exchange

image thumbnail

Classic Snake Game in MATLAB GUI

version 1.2.0.0 (260 KB) by Akash Gupta
Enjoy a simple and easy to play game where the snake needs to feed on its prey.

42 Downloads

Updated 26 Oct 2010

View License

Unzip the 'Snake.zip' and run the game.m file. The game controls are present on the GUI screen that comes up and are self explanatory, although small annotations have been added for easier grasp.

Hope you enjoy.
A better version with subtle scoring methods and riskier play will be uploaded in time.

Comments and Ratings (12)

Chiu sao huan

good feature

MOHIT

MOHIT (view profile)

Pooja

Pooja (view profile)

how do i download this code??
any body can help me ?

Vinh Le

w sq

w sq (view profile)

Although your program is good, i found it coundn't resume when I pushed the 'PAUSE' button. Matlab 'paush' function can be waken up by any key, but it is just once. What's mean is that when you click one time, it's be waked up. But this doesn't continuous. So can you solve this little problem?

Akash Gupta

The game is designed through the application of mild image processing.

Akash Gupta

The wavplay error has been redeemed.
To exit, one will have to stop the execution of the game by going to MATLAB command line and typing CTRL+C.
This is my first attempt at such an endeavour and I haven't seen other submissions in this regard.

Binbin Qi

i don't know how to exit the game?can you tell me?

Perhaps you can explain how this is better/worse/different than previous snake-game submissions:
http://www.mathworks.com/matlabcentral/fileexchange/?term=snake+nokia

Sean de

Sean de (view profile)

??? Error using ==> wavplay at 36
WAVPLAY is only for use with Windows machines.

Use a simple check:
if ispc; wavplay...;end
So those of us without windows don't get an error every time we get the food.

Updates

1.2.0.0

will not give error on Linux.

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

MATLAB Online Live Editor Challenge

View the winning live scripts from faculty and students who participated in the recent challenge.

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video