Modify width of the beam if you like ;)
parent
a0b673afc1
commit
3f7ae0846a
|
@ -77,6 +77,14 @@ def main():
|
|||
simulation_running = False
|
||||
else:
|
||||
simulation_running = True
|
||||
elif event.key == K_COMMA:
|
||||
universe.settings.beam_width -= 5
|
||||
if(universe.settings.beam_width < 5):
|
||||
universe.settings.beam_width = 5
|
||||
elif event.key == K_PERIOD:
|
||||
universe.settings.beam_width += 5
|
||||
|
||||
|
||||
|
||||
print "Pygame thread exited."
|
||||
|
||||
|
@ -123,8 +131,13 @@ class Screen:
|
|||
pygame.draw.circle(self.window, RED, end_position, 2)
|
||||
def draw_guide(self):
|
||||
y = self.universe.settings.initial_y
|
||||
offset = self.universe.settings.beam_width
|
||||
for x in range(0, 39, 2):
|
||||
pygame.draw.aaline(self.window, BLACK, (X_SCREEN_BORDER*x/40, y), (X_SCREEN_BORDER*(x+1)/40, y), 4)
|
||||
for x in range(0, 79, 2):
|
||||
pygame.draw.aaline(self.window, RED, (X_SCREEN_BORDER*x/80, y + offset), (X_SCREEN_BORDER*(x+1)/80, y + offset), 2)
|
||||
for x in range(0, 79, 2):
|
||||
pygame.draw.aaline(self.window, RED, (X_SCREEN_BORDER*x/80, y - offset), (X_SCREEN_BORDER*(x+1)/80, y - offset), 2)
|
||||
|
||||
|
||||
|
||||
|
@ -201,6 +214,7 @@ class SimulationSettings:
|
|||
self.instructions = [ "Instructions:",
|
||||
"To change speed, use right and left arrow keys",
|
||||
"To change position of the beam, use up and down arrow keys",
|
||||
"To change width of the beam, use , and . keys",
|
||||
"To add particle, press space",
|
||||
"To stop/restart simulation, press enter"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue