PDA

View Full Version : Modifying constant.




julesv
Apr 1, 2009, 08:16 AM
I have a simple game based on Image views.
The difficulty of the game is relative to this constant defined at the beginning of the M file as such:

#define Difficulty 13

I would like to change this value using a slider, but I am failing. Please help!



themoonisdown09
Apr 1, 2009, 08:18 AM
Why does it have to be a constant?

julesv
Apr 1, 2009, 08:23 AM
I don't know... I'm very new so just tell me what's up in the program that is wrong. I guess I nave to learn via my mistakes. I thought that was a constant....

jnic
Apr 1, 2009, 08:44 AM
Constants, by definition, can't be changed. You want a variable. Try:

int difficulty = 13;

You probably want to re-read the basics of Objective-C before continuing.