sebastian
Übersicht
Seiten in dieser Kategorie:
http://www.spielend-programmieren.at
- mycode1.py
import random as r import turtle as t t.colormode(255) block = 0 for x in range(1000): t.pensize(r.randint(0,30)) t.pencolor(r.randint(0,255),r.randint(0,255),r.randint(0,255)) t.fd(r.randint(-1000,1000)) t.left(r.randint(-1400,1400)) t.bgcolor(r.randint(0,255),r.randint(0,255),r.randint(0,255)) if t.position()[0]<-400 or t.position()[0]>400 or t.position()[1] < -400 or t.position()[1] > 400: t.penup() t.goto(0,0) t.pendown()
coding………….:
- code1.py
# -*- coding: utf-8 -*- import easygui as e import random as r antwort = "" while True: e.buttonbox("wilkommen beim Portalspiel möchten sie spielen???","Portalspiel",["Nein", "JA"], "titlepicture.gif") if antwort == "JA": break else: e.msgbox("musst du aber")
hehe leute guck mal DAs kuĥle spiel!!!!
- strasse.py
import turtle as t import easygui as e import random as r t.colormode(255) def house(breite=100): dach = ((breite/2)**2+(breite/2)**2)**0.5 t.fd(breite) t.left(90) t.fd(breite) t.left(90) t.fd(breite) t.left(90) t.fd(breite) t.left(90) t.fd(breite) t.left(90) t.fd(breite) t.left(45) t.fd(dach) t.left(90) t.fd(dach) t.left(180) t.fd(dach/2) t.left(45) t.fd(breite/100*40) t.left(90) t.fd(breite/100*15) t.left(90) t.fd(breite/100*54) t.left(45) t.penup() t.fd(dach/2-15)#faehrt zum dachboden t.left(45) t.fd(breite/100*20) t.right(90) t.fd(breite/100*44.5) t.pendown() for x in range(4): t.right(90) t.fd(breite/100*30) t.penup() t.fd(breite/100*40) t.pendown() for x in range(4): t.right(90) t.fd(breite/100*30) t.penup() t.left(180) t.fd(breite/100*70.5) t.right(90) t.fd(breite/100*40) t.pendown() for x in range(4): t.right(90) t.fd(breite/100*30) t.penup() t.right(90) t.fd(breite/100*81) t.pendown() #tuer t.left(180) t.fd(breite/100*40) t.left(90) t.fd(breite/100*25) t.left(90) t.fd(breite/100*40) t.right(90) t.fd(breite/100*25) #zum start zurueck t.penup() t.fd(breite/100*41) t.right(180) t.pendown() t.penup() t.fd(-500) t.right(90) t.fd(280) t.left(90) t.pendown() t.pensize(3) t.bgcolor(r.randint(0,255),r.randint(0,255),r.randint(0,255)) t.speed(20) while True: for hausnummer in range(7): t.pencolor(r.randint(0,255),r.randint(0,255),r.randint(0,255)) house(100) t.penup() t.fd(150) t.pendown() t.penup() t.left(180) t.fd(1020) t.right(90) t.fd(200) t.right(90) t.pendown()
PENTAGRAMM
- pentagramm1.py
# -*- coding: utf-8 -*- import pygame pygame.init() screen=pygame.display.set_mode((640,480)) background = pygame.Surface(screen.get_size()) background.fill((255,255,255)) # fill the background white (red,green,blue) background = background.convert() # faster blitting ballsurface = pygame.Surface((50,50)) # create a rectangular surface for the ball #pygame.draw.circle(Surface, color, pos, radius, width=0) # from pygame.org documentation pygame.draw.circle(ballsurface, (255,0,0), (600,300),200) # draw blue filled circle on ball surface ballsurface = ballsurface.convert() # faster blitting ballx = 320 bally = 240 pygame.draw.lines(background,(0,0,255),True,[(250,20),(300,200),(100,100),(400,100),(190,200)]) pygame.draw.ellipse(background, (0,255,0), (100,20,300,180),3) #------- blit the surfaces on the screen to make them visible screen.blit(background, (0,0)) # blit the background on the screen (overwriting all) screen.blit(ballsurface, (ballx, bally)) # blit the topleft corner of ball surface at pos (ballx, bally) clock = pygame.time.Clock() mainloop = True FPS = 30 # desired framerate in frames per second. try out other values ! playtime = 0.0 while mainloop: milliseconds = clock.tick(FPS) # do not go faster than this frame rate playtime += milliseconds / 1000.0 # ----- event handler ----- for event in pygame.event.get(): if event.type == pygame.QUIT: mainloop = False # pygame window closed by user elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: mainloop = False # user pressed ESC pygame.display.set_caption("Frame rate: %.2f frames per second. Playtime: %.2f seconds" % (clock.get_fps(),playtime)) pygame.display.flip() # flip the screen like in a flipbook print "this 'game' was played for %.2f seconds" % playtime






