Hello everyone, got a question here since I'm stumped on trying to get it setup. I wanted to see if there's a way to choose a different set of enums when using a different device. Basically what I have is some object movement speeds defined in a "type enum" and if the device is an iPad I want those values doubled since the larger screen has more room. I tried using the UIUserInterfaceIdiom option to check if it's an iPad or not, but I can't seem to figure out how to use those in a if statement to choose a different typedef enum list. I don't know what code to supply, so if you want me to show what I've tried here's what I have below:
Code:
//Setup Movement Speeds
typedef enum {
#if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone
NormalSpeed = 2,
SlowSpeed = 1,
FastSpeed = 4,
ConfusedSpeed = -2
#elif UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
NormalSpeed = 4,
SlowSpeed = 2,
FastSpeed = 8,
ConfusedSpeed = -4
#endif
} MovementSpeeds;
This code above doesn't work but is essentially what I'm trying to achieve. I get a "Token [ is not valid in preprocessor expressions" which doesn't really make sense since I'm not using a bracket anywhere but I'm sure it's probably something else that I'm trying to do incorrectly but can't figure out how to fix this. I wanted to do it this way so I don't have to constantly check for device type when changing speeds throughout the level.