How to create Jumpy with Pagame part 1

First we create a screen surface and we make the neverending loop to control what’s going on on the screen surface. Cool!

jumpy game pygame part 1
#import libraries
import pygame

#initialise pygame
pygame.init()

#game window dimensions
SCREEN_WIDTH = 400
SCREEN_HEIGHT = 600

#create game window
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Jumpy')

#load images
bg_image = pygame.image.load('assets/bg.png').convert_alpha()



#game loop
run = True
while run:

	#draw background
	screen.blit(bg_image, (0, 0))



	#event handler
	for event in pygame.event.get():
		if event.type == pygame.QUIT:
			run = False


	#update display window
	pygame.display.update()



pygame.quit()

https://github.com/russs123/Jumpy


Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.