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 Jan 28 17:32:54 2015 +0000
Revision:
0:87ab172a74b4
Separated elements as objects, added gravity and bouncespeed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maxint 0:87ab172a74b4 1 #pragma once
maxint 0:87ab172a74b4 2 #include "mbed.h"
maxint 0:87ab172a74b4 3
maxint 0:87ab172a74b4 4 class Vector
maxint 0:87ab172a74b4 5 {
maxint 0:87ab172a74b4 6 public:
maxint 0:87ab172a74b4 7 float x;
maxint 0:87ab172a74b4 8 float y;
maxint 0:87ab172a74b4 9
maxint 0:87ab172a74b4 10 Vector();
maxint 0:87ab172a74b4 11 Vector(float fX, float fY);
maxint 0:87ab172a74b4 12 void set(float dX, float fY);
maxint 0:87ab172a74b4 13 void set(int nX, int nY);
maxint 0:87ab172a74b4 14 float getSize();
maxint 0:87ab172a74b4 15 bool isLeft();
maxint 0:87ab172a74b4 16 bool isRight();
maxint 0:87ab172a74b4 17 bool isUp();
maxint 0:87ab172a74b4 18 bool isDown();
maxint 0:87ab172a74b4 19 void add(float fAdd);
maxint 0:87ab172a74b4 20 void add(Vector vAdd);
maxint 0:87ab172a74b4 21 void multiply(Vector vMult);
maxint 0:87ab172a74b4 22 };