Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame, sys
- from pygame.locals import *
- pygame.init()
- mainClock = pygame.time.Clock()
- WINDOWWIDTH = 800
- WINDOWHEIGHT = 600
- windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT), 0, 32)
- pygame.display.set_caption('Ude ga kento-chigai ni naru koto ga dekimasu')
- moveLeft = False
- moveRight = False
- moveUp = False
- moveDown = True
- moveSpeed = 4
- BLACK = (0, 0, 0)
- WHITE = (255, 255, 255)
- GREEN = (0, 255, 0)
- px = int(0.1)
- py = int(0.1)
- player = pygame.Rect(400(px), 300(py), 10, 10)
- floor = pygame.Rect(0, 500, 800, 100)
- while True:
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- while moveDown == True:
- py += int(1.5)
- pygame.draw.rect(windowSurface, WHITE, player)
- pygame.draw.rect(windowSurface, GREEN, floor)
- pygame.display.update()
- mainClock.tick(40)
Add Comment
Please, Sign In to add comment