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.
SoundBlock.h
00001 #ifndef __SOUNDBLOCK_H__ 00002 #define __SOUNDBLOCK_H__ 00003 00004 #define US_PER_BIT 32 00005 00006 // Fix16 representation of 1000000/32 00007 #define FREQ_NUMERATOR 0x7a120000 00008 00009 #define TONE(stepCount, stepDuration, pitch, pitchSlide, duty, dutySlide) SoundBlock(SoundBlock::Tone, stepCount, stepDuration, pitch, pitchSlide, duty, dutySlide) 00010 #define NOISE(stepCount, stepDuration, pitch, pitchSlide) SoundBlock(SoundBlock::Noise, stepCount, stepDuration, pitch, pitchSlide, 128, 0) 00011 #define PAUSE(stepCount, stepDuration) SoundBlock(SoundBlock::Pause, stepCount, stepDuration, 0, 0, 0, 0) 00012 00013 #define CREATE_EFFECT(name) \ 00014 static const SoundBlock name[] = \ 00015 { \ 00016 00017 #define END_EFFECT \ 00018 }; 00019 00020 #define EFFECT(name) name, sizeof(name)/sizeof(SoundBlock) 00021 00022 class SoundChannel; 00023 00024 class SoundBlock 00025 { 00026 public: 00027 enum ToneType {Tone, Noise, Pause}; 00028 00029 public: 00030 SoundBlock(ToneType toneType, uint16_t stepCount, uint16_t stepDuration, uint16_t pitch, int16_t pitchSlide, uint8_t duty, int8_t dutySlide); 00031 SoundBlock(ToneType toneType, uint16_t stepCount, uint16_t stepDuration); 00032 00033 protected: 00034 SoundBlock(); 00035 00036 private: 00037 void initialize(ToneType toneType, uint16_t stepCount, uint16_t stepDuration, uint16_t pitch, int16_t pitchSlide, uint8_t duty, int8_t dutySlide); 00038 00039 protected: 00040 inline ToneType getToneType() { return _toneType; } 00041 inline uint16_t getStepCount() { return _stepCount; } 00042 inline uint16_t getStepDuration() { return _stepDuration; } 00043 inline fix16_t getPitch(fix16_t offset) { return fix16_div(FREQ_NUMERATOR, _pitch + offset); } 00044 inline fix16_t getPitchSlide() {return _pitchSlide; } 00045 inline uint8_t getDuty(int8_t offset) { return (uint8_t)(_duty + offset); } 00046 inline int8_t getDutySlide() { return _dutySlide; } 00047 00048 private: 00049 ToneType _toneType; 00050 uint16_t _stepCount; 00051 uint16_t _stepDuration; 00052 fix16_t _pitch; 00053 fix16_t _pitchSlide; 00054 uint8_t _duty; 00055 int8_t _dutySlide; 00056 00057 friend class SoundChannel; 00058 }; 00059 #endif //__SOUNDBLOCK_H__ 00060 00061
Generated on Wed Jul 13 2022 06:18:15 by 1.7.2