I am making a physics related program in pygame for my coursework. The topic is simple harmonic motion and my program will (hopefully) show a simple pendulum in motion alongside all the relative values of its speed, acceleration, displacement etc. To begin the simulation I require the user to enter some values about the motion of this pendulum, such as its amplitude, time period and the length of its string.
My first question is how would I get this input, rather than writing code for every scenario (i.e if keydown = 1:, if keydown = 2:, if keydown = 3: etc...) is there anyway of generalizing the whole list of integars so I can say, if the keydown is an integer then the time period = input.
Secondly I want this to happen during real time so that once they enter the number they can see it and amend it before pressing enter to confirm it, like you would on a normal form, how would I go about blitting the values in real time?
I apologize if the questions seem really naive but the only computer programming I have done so far have been very specific to the exam board syllabus which doesn't allow for a very wide scope.