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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SoundChannel.h Source File

SoundChannel.h

00001 #ifndef __SOUNDCHANNEL_H__
00002 #define __SOUNDCHANNEL_H__
00003 class SoundChannel
00004 {   
00005 public: 
00006     SoundChannel();
00007     
00008     protected:
00009         void play(const SoundBlock soundBlocks[], int count);
00010         bool update(bool &pinState);            
00011     
00012     private:
00013         void updateTone();
00014         void updateNoise();
00015         
00016         void startSoundBlock();
00017         bool updateCounters();
00018         void updateAudioCounters();
00019         
00020         static uint16_t lfsr_rand();
00021         
00022     private:
00023         int         _state;
00024         uint16_t    _stepCounter;
00025         uint16_t    _stepDurationCounter;
00026         fix16_t     _basePitchHighCount;
00027         fix16_t     _basePitchLowCount;
00028         fix16_t     _pitchHighCounter;
00029         fix16_t     _pitchLowCounter;
00030         fix16_t     _pitchOffset;
00031         fix16_t     _dutyOffset;
00032         
00033         const SoundBlock *_soundBlocks;        
00034         int         _count;
00035         int         _index;  
00036         bool        _pinState;
00037         
00038         SoundBlock  _currentSoundBlock;
00039         
00040     friend class OneBitSound;           
00041 };
00042 #endif //__SOUNDCHANNEL_H__