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
На этой странице сайта вы можете посмотреть видео онлайн Build a Tile-Based Platformer - Python PyGame Tutorial Part 1 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь The Python Lab 01 Январь 1970, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 728 раз и оно понравилось 15 зрителям. Приятного просмотра!