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
In questa pagina del sito puoi guardare il video online Build a Tile-Based Platformer - Python PyGame Tutorial Part 1 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato The Python Lab 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 728 volte e gli è piaciuto 15 spettatori. Buona visione!