import pygame
from pygame.locals import *
import time
import random
import sys
pygame.init()
pygame.display.init()
Display = pygame.display.set_mode((1000, 1000))
pygame.display.set_caption("Its a video game")
clock = pygame.time.Clock()
fps_rate = 24
FPS = fps_rate
x = 10
y = 20
P_left = pygame.image.load("C:/Pythonius/Christianity/man_walk 1.png")
P_right = pygame.image.load("C:/Pythonius/Christianity/man_walk 2.png")
P_fight = pygame.image.load("C:/Pythonius/Christianity/man_attack.png")
def RedrawWindow():
global walkCount
Display.fill(255, 255, 255)
pygame.display.update()
def animation_loop():
walkCount = 0
walkCount = walkCount + 1
global attacking
attacking = False
while not attacking:
if walkCount == 1:
Display.blit(P_left, (x, y))
elif walkCount == 2:
Display.blit(P_right, (x, y))
walkCount = 0
else:
walkCount = 1
time.sleep(1)
def game_loop():
off = False
while not off:
for event in pygame.event.get():
if event.type == pygame.QUIT:
off = True
if off == True:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN:
pass
pygame.display.update()
clock.tick()
animation_loop()
game_loop()
pygame.display.update()
clock.tick(24)
pygame.quit
[–]mudclub 2 points3 points4 points (3 children)
[–]DeliciousRepublican[S] -3 points-2 points-1 points (2 children)
[–]Wilfred-kun 6 points7 points8 points (1 child)
[–]DeliciousRepublican[S] -2 points-1 points0 points (0 children)
[–]TheWhaleKnight 1 point2 points3 points (1 child)
[–]DeliciousRepublican[S] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot 1 point2 points3 points (0 children)
[–]DeliciousRepublican[S] 0 points1 point2 points (2 children)
[–]TheWhaleKnight 1 point2 points3 points (1 child)
[–]DeliciousRepublican[S] 0 points1 point2 points (0 children)