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.
OneBitSound/SoundChannel.h@16:f9227904afc4, 2015-02-16 (annotated)
- Committer:
- taylorza
- Date:
- Mon Feb 16 03:46:57 2015 +0000
- Revision:
- 16:f9227904afc4
- Parent:
- 5:a758c7d4da03
Added a 4th game screen
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
taylorza | 5:a758c7d4da03 | 1 | #ifndef __SOUNDCHANNEL_H__ |
taylorza | 5:a758c7d4da03 | 2 | #define __SOUNDCHANNEL_H__ |
taylorza | 5:a758c7d4da03 | 3 | class SoundChannel |
taylorza | 5:a758c7d4da03 | 4 | { |
taylorza | 5:a758c7d4da03 | 5 | public: |
taylorza | 5:a758c7d4da03 | 6 | SoundChannel(); |
taylorza | 5:a758c7d4da03 | 7 | |
taylorza | 5:a758c7d4da03 | 8 | protected: |
taylorza | 5:a758c7d4da03 | 9 | void play(const SoundBlock soundBlocks[], int count); |
taylorza | 5:a758c7d4da03 | 10 | bool update(bool &pinState); |
taylorza | 5:a758c7d4da03 | 11 | |
taylorza | 5:a758c7d4da03 | 12 | private: |
taylorza | 5:a758c7d4da03 | 13 | void updateTone(); |
taylorza | 5:a758c7d4da03 | 14 | void updateNoise(); |
taylorza | 5:a758c7d4da03 | 15 | |
taylorza | 5:a758c7d4da03 | 16 | void startSoundBlock(); |
taylorza | 5:a758c7d4da03 | 17 | bool updateCounters(); |
taylorza | 5:a758c7d4da03 | 18 | void updateAudioCounters(); |
taylorza | 5:a758c7d4da03 | 19 | |
taylorza | 5:a758c7d4da03 | 20 | static uint16_t lfsr_rand(); |
taylorza | 5:a758c7d4da03 | 21 | |
taylorza | 5:a758c7d4da03 | 22 | private: |
taylorza | 5:a758c7d4da03 | 23 | int _state; |
taylorza | 5:a758c7d4da03 | 24 | uint16_t _stepCounter; |
taylorza | 5:a758c7d4da03 | 25 | uint16_t _stepDurationCounter; |
taylorza | 5:a758c7d4da03 | 26 | fix16_t _basePitchHighCount; |
taylorza | 5:a758c7d4da03 | 27 | fix16_t _basePitchLowCount; |
taylorza | 5:a758c7d4da03 | 28 | fix16_t _pitchHighCounter; |
taylorza | 5:a758c7d4da03 | 29 | fix16_t _pitchLowCounter; |
taylorza | 5:a758c7d4da03 | 30 | fix16_t _pitchOffset; |
taylorza | 5:a758c7d4da03 | 31 | fix16_t _dutyOffset; |
taylorza | 5:a758c7d4da03 | 32 | |
taylorza | 5:a758c7d4da03 | 33 | const SoundBlock *_soundBlocks; |
taylorza | 5:a758c7d4da03 | 34 | int _count; |
taylorza | 5:a758c7d4da03 | 35 | int _index; |
taylorza | 5:a758c7d4da03 | 36 | bool _pinState; |
taylorza | 5:a758c7d4da03 | 37 | |
taylorza | 5:a758c7d4da03 | 38 | SoundBlock _currentSoundBlock; |
taylorza | 5:a758c7d4da03 | 39 | |
taylorza | 5:a758c7d4da03 | 40 | friend class OneBitSound; |
taylorza | 5:a758c7d4da03 | 41 | }; |
taylorza | 5:a758c7d4da03 | 42 | #endif //__SOUNDCHANNEL_H__ |