Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import random
- import pygame
- import sys
- red = (255, 0, 0)
- white = (255, 255, 255)
- green = (0, 128, 0)
- black = (0, 0, 0)
- cherry = (145, 30, 66)
- fon = (78, 74, 59)
- def pixel(surface, color, pos):
- surface.fill(color, (pos, (1, 1)))
- def cosMY(surface, color, pos, half_length):
- for xx in range(half_length*10):
- x = xx * 0.1
- #pixel(surface, color, (x + pos[0], math.cos(x)+ pos[1]))
- pixel(surface, color, (pos[0] + x*100, pos[1] + math.cos(x)*100))
- pygame.draw.aaline(screen, black, (pos[0] + x*100, pos[1] + math.cos(x)*50), (pos[0] + (x+1)*50, pos[1] + math.cos(x+1)*50))
- pygame.init()
- screen = pygame.display.set_mode((1080, 720))
- clock = pygame.time.Clock()
- while True:
- screen.fill(white)
- pygame.draw.line(screen, red, (0, 720/2), (1080, 720/2), 1)
- pygame.draw.line(screen, red, (1080/2, 0), (1080/2,720), 1)
- pixel(screen, black, (1080/2,720/2))
- cosMY(screen, black, (1080/(15/2),720/2), 15)
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- pygame.quit()
- sys.exit()
- pygame.display.flip()
- clock.tick(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement