Texture Loading | Coding Terraria in Python | Pygame Tutorial Ep. 3

preview_player
Показать описание
Thanks for watching!

I know that this video seems kind of pointless at the time being, but as we add 100-200 different blocks, our approach to texture loading will become increasingly important.

Join my Discord!

Support me on Patreon if you wish!
Рекомендации по теме
Комментарии
Автор

Hello all, Thanks coding sphere for this very good, very clean tutorial.

Trying to follow your tutoial with pygame 2.5.2, I encountered an issue with the line:
texture['name'] = pygame.Surface.subsurface(atlas_img, pygamre.Rect(...))
it seems that pygame change the way of working of subsurface, that shall be called directly on a surface object (atlas_img), which gives now:
texture['name'] =

I hope this will help stuck people.
A big thanks for this wonderful tutorial.

thomasmaugis
Автор

I'd like to thank you for your helpful contents, and I've enjoyed a lot.
BTW, I wonder why 16 is multiplied to make atlas_image. and I'd like to know how atlas image can be split into grass and stone each.

sjahn
Автор

i have a very weird problem where there is an empty black sprite on the top left corner and i cant find where it comes from

silvicide
Автор

Great tutorial again. Please provide the assets as a link in the description next time though :<
We do not have access to the same images as you.
Also, I seperated the 'gen_solo_textures' and 'gen_atlas_textures' methods away from the scene, and into a seperate class called 'TextureManager' to be cleaner

modernmage
Автор

got an issue with stone loading, i did as the tutorial said but it still didnt work
Exception has occurred: KeyError
'stoneblock'
File line 17, in __init__
Entity([self.sprites], position=(200, 200),

File line 15, in __init__
self.scene = Scene(self)

File line 36, in <module>
game = Game()

KeyError: 'stoneblock'

lllnanlll