Pages

Wednesday, February 26, 2014

silly one.

#brain fried.  Need to sleep. 
#Here's my pooping unicorn as of now.... but the unicorn is invisible. 

import pygame
import random
import sys

from pygame.locals import*

background_image_file = 'CRSwall.jpg'
mouse_image_file = 'brush.png'
   


def main():   
    pygame.init()
   
    SCREEN = pygame.display.set_mode((600,800))
    pygame.display.set_caption('Nellie wants to be a Geek!')
   
    BACKGROUND = pygame.image.load(background_image_file).convert()
    mouse_cursor = pygame.image.load(mouse_image_file).convert()
   
   
    SCREEN.blit(BACKGROUND,(-10, -10))
   
    x1 = random.randint(0, 255)
    y1 = random.randint(10, 245)
    z1 = random.randint(15, 200)
   
    RAINBOW1 = (x1, y1, z1)

    BLACK = (0, 0, 0)
    WHITE = (255, 255, 255)
    PURPLE = (255, 0, 220)
    BLUE = (74, 74, 250)

    font = pygame.font.Font(None, 49)
    text = font.render("Pooping Unicorn! Clicky clicky!", False, RAINBOW1)
    textPos = text.get_rect()
    textPos.centerx = BACKGROUND.get_rect().centerx
   
    pygame.draw.rect(BACKGROUND, (100, 255, 255), (0, 0, 600, 60))
    pygame.draw.rect(SCREEN, (255, 200, 50), (800, 0, 600, 60))
   
   
    (mouseX, mouseY) = pygame.mouse.get_pos()
    pygame.draw.circle(BACKGROUND, (RAINBOW1), (mouseX, mouseY), 20, 20)
    x1 = random.randint(0, 255)
    y1 = random.randint(10, 245)
    z1 = random.randint(15, 200)
    RAINBOW1 = (x1, y1, z1)

    pygame.display.update()
    #screen.blit(ball.image, ball.rect)
    BACKGROUND.blit(text, textPos)   
        SCREEN.blit(BACKGROUND, (0,0))       
    pygame.display.flip()

    while 1:   
       
        for event in pygame.event.get():
            if event.type == QUIT:
                pygame.quit()
                sys.exit()   
            if event.type == MOUSEBUTTONDOWN :
                main()
               
                BACKGROUND.blit(text, textPos)
                SCREEN.blit(mouse_cursor.image, mouse_cursor.rect)

if __name__ == '__main__': main()

   

No comments:

Post a Comment