In this Python tutorial I code a Tile Based Platformer Game using the PyGame module. I'm going to cover the initial game setup and how to create the map.
Timelabs
00:00 Intro
00:13 downloading assets
00:47 import pygame
00:58 create a blank window
02:11 add a way of closing the game
03:47 5x5 Gid-system
04:40 create world class
05:25 import os
05:48 load all images
06:58 literate through this tile list
09:29 define draw function
10:06 create a instance of world
11:13 end credits
world_data = [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 118, 0, 62, 0, 0, 0, 0, 0, 49, 0],
[0, 0, 0, 0, 0, 179, 180, 180, 181, 0, 0, 0, 184, 183, 185],
[0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 167, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 179, 180, 180, 180, 181, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177],
[0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 37, 0, 37, 0, 0, 0, 0, 177, 0],
[62, 0, 0, 116, 125, 128, 0, 0, 0, 0, 116, 0, 0, 62, 0],
[175, 174, 174, 174, 174, 176, 312, 312, 312, 175, 174, 174, 174, 174, 176],
[172, 171, 171, 171, 171, 173, 310, 310, 310, 172, 171, 171, 171, 171, 173],
[172, 171, 171, 171, 171, 173, 310, 310, 310, 172, 171, 171, 171, 171, 173],
]
#python #pygame #gamedev #platformer #coding #programming
Sur cette page du site, vous pouvez voir la vidéo en ligne Build a Tile-Based Platformer - Python PyGame Tutorial Part 1 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur The Python Lab 01 janvier 1970, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 728 fois et il a aimé 15 téléspectateurs. Bon visionnage!