Skip to content

Commit

Permalink
changed framerate definitions in all the files so that only dt needs …
Browse files Browse the repository at this point in the history
…to be chanegd
  • Loading branch information
Ethan Peterson committed May 22, 2018
1 parent c97353f commit 9063e8a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 2D_Motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def restart():
# simulation loop

while ball.pos.y >= ground.pos.y:
rate(100) # set loop to run 100 times a second
rate(1.0 / dt) # set loop to run 100 times a second
keyPress(ballScene)
#print(restart(ballScene))

Expand Down
2 changes: 1 addition & 1 deletion energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@


while True:
rate(100)
rate(1.0 / dt)
keyPress(scene)
if block.pos.x < blockWidth / 2: # When block is sliding down the ramp
# dt is such a small number that we are calculating the AROC on such a small interval that we are more or less getting instantaneous values (Calculus Application)
Expand Down
2 changes: 1 addition & 1 deletion freefall_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def restart():
# simulation loop

while ball.pos.y >= 0:
rate(100) # set loop to run 100 times a second
rate(1.0 / dt) # set loop to run 100 times a second

keyPress(ballScene)

Expand Down
2 changes: 1 addition & 1 deletion freefall_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def restart():
# simulation loop

while ball.pos.y >= ground.pos.y:
rate(100) # set loop to run 100 times a second
rate(1.0 / dt) # set loop to run 100 times a second

keyPress(ballScene)

Expand Down
2 changes: 1 addition & 1 deletion momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ def updatePos(rightInMotion, time): # takes boolean indicating which pendulum st

rightInMotion = True # start with the right pendulum in motion
while True:
rate(100)
rate(1.0 / dt)
rightInMotion = updatePos(rightInMotion, t)
t += dt

0 comments on commit 9063e8a

Please sign in to comment.