This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace std; | |
map <char, OIS::KeyCode> createKeyMap() { | |
map<char, OIS::KeyCode> m; | |
m['a'] = OIS::KC_A; | |
m['b'] = OIS::KC_B; | |
m['c'] = OIS::KC_C; | |
m['d'] = OIS::KC_D; | |
m['e'] = OIS::KC_E; | |
m['f'] = OIS::KC_F; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface GameKeyboard : NSObject<UITextFieldDelegate> | |
@property (nonatomic, strong) UITextField *textField; | |
+ (GameKeyboard *)sharedInstance; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void playBackgroundMusic(std::string filename); | |
void stopBackgroundMusic(); | |
unsigned int playEffect(std::string filename); | |
unsigned int playEffect(std::string filename,float pitch, float pan, float gain); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation GameAudio | |
void playBackgroundMusic(std::string filename) | |
{ | |
[SimpleAudioEngine sharedEngine].backgroundMusicVolume = 0.25; | |
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:[NSString stringWithCString:filename.c_str() encoding:[NSString defaultCStringEncoding]]]; | |
} | |
void stopBackgroundMusic() | |
{ |
NewerOlder