forked from bedohswe/p3he
Add a button to disable FPS cap.
This commit is contained in:
parent
84baa55a0c
commit
8169e9e7c3
8
main.py
8
main.py
@ -20,6 +20,7 @@ ROT = cNorm(exp(deg2rad(2)*I))
|
|||||||
IROT = 1/ROT
|
IROT = 1/ROT
|
||||||
F = 5 * 10**7
|
F = 5 * 10**7
|
||||||
F_ = 10**9
|
F_ = 10**9
|
||||||
|
bCap = True
|
||||||
|
|
||||||
gOrigin = GyroVector(0,1)
|
gOrigin = GyroVector(0,1)
|
||||||
|
|
||||||
@ -109,6 +110,9 @@ def mainLoop():
|
|||||||
gPlayer.cRot *= -1
|
gPlayer.cRot *= -1
|
||||||
if event.key == pygame.K_F3:
|
if event.key == pygame.K_F3:
|
||||||
debugInfo = not debugInfo
|
debugInfo = not debugInfo
|
||||||
|
if event.key == pygame.K_F1:
|
||||||
|
global bCap
|
||||||
|
bCap = not bCap
|
||||||
if event.key == pygame.K_F2:
|
if event.key == pygame.K_F2:
|
||||||
if (len(wall_buffer) == 1):
|
if (len(wall_buffer) == 1):
|
||||||
wall_buffer.append(gPlayer.cPos)
|
wall_buffer.append(gPlayer.cPos)
|
||||||
@ -155,8 +159,10 @@ def mainLoop():
|
|||||||
pygame.draw.rect(display, WHITE, (c.real * 100 + 95, (c.imag * 100 + 195), 10, 10))
|
pygame.draw.rect(display, WHITE, (c.real * 100 + 95, (c.imag * 100 + 195), 10, 10))
|
||||||
|
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
if bCap:
|
||||||
clock.tick(60)
|
clock.tick(60)
|
||||||
|
else:
|
||||||
|
clock.tick()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user