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.

Revision:
0:87ab172a74b4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Shapes.h	Wed Jan 28 17:32:54 2015 +0000
@@ -0,0 +1,64 @@
+#pragma once
+#include "mbed.h"
+#include "Vector.h"
+
+class Point
+{ 
+protected :
+    int x1, y1;
+
+public :
+    Point();
+    Point(int x, int y);
+    int getX();
+    int getY();
+    void set(int x, int y);
+};
+
+class Rectangle
+{
+protected :
+    int x1, x2, y1, y2;
+ 
+public :
+    Rectangle(int x,int y, int x2, int y2);
+    Rectangle(Point pt1, Point pt2);
+    bool collides(Point pt);
+    bool collides(Rectangle r);
+
+    void set(Rectangle rNew);
+    
+    Point get1();
+    Point get2();
+    Point get3();
+    Point get4();
+    Point getCenter();
+
+    int getX1();
+    int getX2();
+    int getY1();
+    int getY2();
+    int getCenterX();
+    int getCenterY();
+    void move(Vector v);
+};
+
+class Circle
+{ 
+protected :
+    int x1, y1, r1;
+
+public :
+    Circle(int x,int y, int r);
+    Point getCenter();
+    int getRadius();
+    int getX();
+    int getY();
+    void setX(int x);
+    void setY(int y);
+    void setXY(int x, int y);
+    void move(int x, int y);
+    void move(Vector v);
+    Rectangle getBoundingRectangle();
+};
+