Retro game that let's the player steer a ball through a hole filled maze. Has multiple levels of increasing difficulty.

Dependencies:   LCD_ST7735 MusicEngine RETRO_BallsAndThings mbed

Ball and Holes

In this game I attempted to create somewhat natural movement of the ball by implementing gravity and friction which combined over time determine the speed of the ball. Playing with the settings (aka. the magic numbers) that are spread out all over game.cpp, gives different effects, such as an icy, rough or liquid-like surface.

It took some time to figure out how to post my very first youtube video. Sorry for the shaky recording. Trying to record the video with my phone while playing the game in one hand was quite challenging, but here it is;

The left and right buttons are used to cheat: restart the current or go to the next level. Up and down control the game-tick. During game-play the robot-button shows the accelerator graph and the ship-button mutes the sound.

BTW. If your ball happens to get stuck, tilting the console in the opposite direction will set it free. For sake of argument: these magnetic wall-ends are in the words of Bob Ross "a happy accident". Since there is no specific code for it, others might call it a bug. As it results in more interesting game-play, I didn't attempt to fix it, but left a comment for those who dare to look at the mess I call code.

Committer:
maxint
Date:
Wed Feb 04 13:10:36 2015 +0000
Revision:
3:ca8b21da67dc
Parent:
2:d4de5a5866fe
Child:
5:67e75a4f0b52
somehow this version fails. Too much ram usage?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maxint 2:d4de5a5866fe 1 #pragma once
maxint 2:d4de5a5866fe 2 #include "mbed.h"
maxint 2:d4de5a5866fe 3
maxint 2:d4de5a5866fe 4 class SoundFX
maxint 2:d4de5a5866fe 5 {
maxint 2:d4de5a5866fe 6 public:
maxint 2:d4de5a5866fe 7 SoundFX();
maxint 2:d4de5a5866fe 8 void checkPwm();
maxint 2:d4de5a5866fe 9 void reset();
maxint 2:d4de5a5866fe 10 void beep(int nDuration=1);
maxint 2:d4de5a5866fe 11 void beepShort();
maxint 2:d4de5a5866fe 12 void beepLong();
maxint 2:d4de5a5866fe 13 void beepLow();
maxint 2:d4de5a5866fe 14 void playTune();
maxint 3:ca8b21da67dc 15 void setMute(bool fMute);
maxint 3:ca8b21da67dc 16 bool getMute();
maxint 2:d4de5a5866fe 17
maxint 2:d4de5a5866fe 18 private:
maxint 2:d4de5a5866fe 19 static const int BOUNCE1_SOUND_TICKS = 1;
maxint 2:d4de5a5866fe 20 static const int BOUNCE2_SOUND_TICKS = 2;
maxint 2:d4de5a5866fe 21
maxint 2:d4de5a5866fe 22 PwmOut pwm;
maxint 2:d4de5a5866fe 23 int pwmTicksLeft;
maxint 3:ca8b21da67dc 24 bool fMute;
maxint 2:d4de5a5866fe 25 };