Hi,
I'm writing a little game so my pupils can only win, if they do some tests inside the game right.
Something like:
v=s/T
Q=c * m * delta T
Ok.
Now I think hard coding this inside the game is pretty odd, because if one pupil has got the right answer, of course the answer would be shared.
So, I'm thinking of using random numbers for the different questions:
m could e.g. be anything from 5-15, delta T anything from e.g. 17 to 34..., c is constant though.
Now my question:
Is it better to make one room (after starting screen e.g.) and put all those random calculations inside this one room (so they are all handy in one place) and define the data as global variables, or should this be done when necessary in the respective rooms?
Pro one room:
Values for one game stay the same (don't know if this it pro?)
Everything in one place
Better to mange all different questions / values and formulas
Contra:
Lots of global variables needed
How to deal with things like m (weight), if it is used with different values for different questions? (the player should get the right value for having a chance...)
Oh, my idea was to give a input box and compare the entered value with the right one. Any better ways of doing this?
Thank you in advance
Zauberlehrling
I'm writing a little game so my pupils can only win, if they do some tests inside the game right.
Something like:
v=s/T
Q=c * m * delta T
Ok.
Now I think hard coding this inside the game is pretty odd, because if one pupil has got the right answer, of course the answer would be shared.
So, I'm thinking of using random numbers for the different questions:
m could e.g. be anything from 5-15, delta T anything from e.g. 17 to 34..., c is constant though.
Now my question:
Is it better to make one room (after starting screen e.g.) and put all those random calculations inside this one room (so they are all handy in one place) and define the data as global variables, or should this be done when necessary in the respective rooms?
Pro one room:
Values for one game stay the same (don't know if this it pro?)
Everything in one place
Better to mange all different questions / values and formulas
Contra:
Lots of global variables needed
How to deal with things like m (weight), if it is used with different values for different questions? (the player should get the right value for having a chance...)
Oh, my idea was to give a input box and compare the entered value with the right one. Any better ways of doing this?
Thank you in advance
Zauberlehrling