Platform game written for the GHI/OutrageousCircuits RETRO game device. Navigate the caves collecting all the pickups and avoiding the creatures and haunted mine carts that patrol the caves. Oh and remember to watch out for the poisonous plants... This game demonstrates the ability to have multiple animated sprites where the sprites can overlap the background environment. See how the player moves past the fence and climbs the wall in the 3rd screen.

Dependencies:   mbed

Committer:
taylorza
Date:
Sat Dec 27 23:24:30 2014 +0000
Revision:
3:a93fe5f207f5
Working before fixed point audio

Who changed what in which revision?

UserRevisionLine numberNew contents of line
taylorza 3:a93fe5f207f5 1 #include "mbed.h"
taylorza 3:a93fe5f207f5 2 #include "SoundBlock.h"
taylorza 3:a93fe5f207f5 3 #include "SoundChannel.h"
taylorza 3:a93fe5f207f5 4 #include "OneBitSound.h"
taylorza 3:a93fe5f207f5 5
taylorza 3:a93fe5f207f5 6 OneBitSound::OneBitSound(PinName pin) :
taylorza 3:a93fe5f207f5 7 _soundPin(pin)
taylorza 3:a93fe5f207f5 8 {
taylorza 3:a93fe5f207f5 9 _lastPinState = _soundPin;
taylorza 3:a93fe5f207f5 10 _totalElapsed = 0;
taylorza 3:a93fe5f207f5 11 }
taylorza 3:a93fe5f207f5 12
taylorza 3:a93fe5f207f5 13 void OneBitSound::play(const SoundBlock soundBlocks[], int count)
taylorza 3:a93fe5f207f5 14 {
taylorza 3:a93fe5f207f5 15 _channels[0].play(soundBlocks, count);
taylorza 3:a93fe5f207f5 16 }
taylorza 3:a93fe5f207f5 17
taylorza 3:a93fe5f207f5 18 void OneBitSound::update(int elapsedTime)
taylorza 3:a93fe5f207f5 19 {
taylorza 3:a93fe5f207f5 20 _totalElapsed += elapsedTime;
taylorza 3:a93fe5f207f5 21 if (_totalElapsed >= US_PER_BIT)
taylorza 3:a93fe5f207f5 22 {
taylorza 3:a93fe5f207f5 23 bool nextState = false;
taylorza 3:a93fe5f207f5 24 if (_channels[0].update(nextState))
taylorza 3:a93fe5f207f5 25 {
taylorza 3:a93fe5f207f5 26 _soundPin = nextState;
taylorza 3:a93fe5f207f5 27 }
taylorza 3:a93fe5f207f5 28 _totalElapsed -= US_PER_BIT;
taylorza 3:a93fe5f207f5 29 }
taylorza 3:a93fe5f207f5 30 }
taylorza 3:a93fe5f207f5 31
taylorza 3:a93fe5f207f5 32