Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python3
- import pygame
- from time import sleep
- from math import sin
- WIDTH = 1000
- HEIGHT = 700
- def main():
- pygame.init()
- points = {(i, -10) for i in range(HEIGHT)}
- screen = pygame.display.set_mode((WIDTH, HEIGHT))
- surface = pygame.Surface((WIDTH, HEIGHT))
- phase = 0
- while True:
- phase += 0.1
- points = {(i, v+sin(phase+0.01*phase*i)) for (i, v) in points}
- for i, v in points:
- screen.set_at((int(v*30+WIDTH/2), i), 16777215)
- pygame.display.flip()
- sleep(0.01)
- screen.fill(0)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement