Entradas

Pygame Movimiento

Imagen
# -*- coding: utf-8 -*- import pygame import random import time def dibujar_lluvia(window, limites, listaPuntos):     for i in range(len(listaPuntos)):         r = listaPuntos[i][2]         x = listaPuntos[i][0]         y = listaPuntos[i][1]         pygame.draw.circle(window,(255,255,255), [x, y], r, 0)         listaPuntos[i][1] += 1         if listaPuntos[i][1] > limites[1]:             y = random.randrange(-50, -10)             listaPuntos[i][1] = y             x = random.randrange(50, limites[0])             listaPuntos[i][0] = x def crearPuntosAletorios(cantidad, rangos):     listaPuntos = []     for i in range(cantidad):         radio = 1         x =...

Menú Figura Polígonos

Imagen
from Tkinter import * import tkColorChooser v0=Tk() v0.title( 'Ventana principal' ) v0.config( bg = 'green' ) v0.geometry( "200x500" ) def mostrar (num): v1=Toplevel(v0) v1.title( 'ventana hija' ) v1.protocol( 'wn_DELETE_WINDOW' , "onexit" ) v1.geometry( "300x400" ) if num == 1 : f1=Canvas(v1 , width = 200 , height = 200 , bg = 'white' ) f1.pack( expand =YES , fill =BOTH) #cuerpo f1.create_polygon( 110 , 50 , 190 , 50 , 190 , 130 , 230 , 130 , 230 , 250 , 190 , 250 , 190 , 330 , 110 , 330 , 110 , 250 , 70 , 250 , 70 , 130 , 110 , 130 , 110 , 50 , width = 10 , fill = 'tan1' ) #cara f1.create_polygon( 110 , 50 , 190 , 50 , 190 , 80 , 180 , 80 , 180 , 70 , 120 , 70 , 120 , 80 , 110 , 80 , 110 , 50 , width = 1 , fill = 'saddle brown' ) f1.create_polygon( 120 , 90 , 130 , 90 , 130 , 100 , 120 , 100 , 120 , 90 , width = 1 , f...