Archived
1
0
Fork 0

Optimierungen (eclipse)

This commit is contained in:
Findus23 2014-10-08 18:18:24 +02:00
parent 13c6233f1b
commit 6c69525b78

View file

@ -1,39 +1,38 @@
import pygame # import and init pygame
from random import randint
import sys
import time
from random import randint
import pygame #import and init pygame
pygame.init()
pygame.init()
#create the screen
#,pygame.FULLSCREEN
height=480
width=1000
window = pygame.display.set_mode((width, height))
# create the screen
# ,pygame.FULLSCREEN
height = 1000
width = 1800
window = pygame.display.set_mode((width, height))
#draw a line - see http://www.pygame.org/docs/ref/draw.html for more
window.fill((255, 255, 255))
#pygame.draw.line(window, (0, 0, 0), (0, 0), (30, 50))
img = pygame.image.load('baum_mies_mit_rahmen.png')
img = pygame.transform.scale(img, (60, 130))
pygame.display.flip()
x=1
wh=1000.1
c=0.1
wars=10
while x < wh:
# a=randint(0,100)
# pygame.draw.circle(window, (a, randint(100,255), a), (40,40), 40)
b = randint(-64,width+64)
c = c + ((height-134)/wh)
zufall= randint(1,wars+1)
if(zufall==1):
# print "zufall"
# print(c)
window.blit(img,(b,c))
pygame.display.flip()
n = 1
wh = 1000.1
y = 0.1
wars = 10
while n < wh:
# a=randint(0,100)
# pygame.draw.circle(window, (a, randint(100,255), a), (40,40), 40)
y = y + ((height - 134) / wh)
zufall = randint(1, wars + 1)
if(zufall == 1):
# print "zufall"
# print(c)
x = randint(-64, width + 64)
window.blit(img, (x, y))
pygame.display.flip()
# time.sleep(1/wh)
x+=1
# time.sleep(1/wh)
n += 1
#draw it to the screen
# draw it to the screen
time.sleep(5)