Race around the city collecting the flags while avoiding those that stand in the way of your mission. Make no mistake you will need to be quick to outwit your opponents, they are smart and will try to box you in. I wrote this game to prove that writing a game with scrolling scenery is possible even with the limited 6kB of RAM available. I had to compromise sound effects for features, I wanted multiple opponents, I wanted to be able to drop smoke bombs to trap the opponents but all this required memory so the sound effects had to take a back seat.

Dependencies:   mbed

Beeper.h

Committer:
taylorza
Date:
2015-02-01
Revision:
1:1b8125937f28

File content as of revision 1:1b8125937f28:

#include "mbed.h"

#ifndef __BEEPER_H__
#define __BEEPER_H__
class Beeper
{
public:    
    static void beep(int freq, int duration);
    static void noise(int freq, int duration);
    
private:
    static uint16_t lfsr_rand()
    {
        static uint16_t lfsr = 0xACE1u;
        lfsr = (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u);
        return lfsr;
    }
    
private:
    static DigitalOut _speaker;
};
#endif //__BEEPER_H__