Sprites on a Raycasting game in Python with Pygame - Tutorial Devlog

preview_player
Показать описание
Continuing my raycasting game project in Python with Pygame, I'm introducing sprites to represent enemies and the player.
Рекомендации по теме
Комментарии
Автор

really appreciate the video, its amazing how creative an beautiful the method people come up with when theyve limited resources in contrast to having too much resources nowadays and very little creativity

gangsternecoarc
Автор

3:33 Hello, I really couldn't understand this part, I managed to create maps with pseudo 3d like mode7 and raycast but I still can't understand how to make the sprites appear in the room and maintain the scale. I'm doing it with Canvas and pure javascript, could you help me?

RpgCoffee
Автор

Just like Doom 1...
Very very nice... ✅✅✅✅✅✅✅✅

SkyFly
Автор

this is very impressive! Can you recommend any other learning resources for someone trying to implement sprites?

OneEgg
Автор

Great video! I have a question though, when I run your code from github it gives an error: Traceback (most recent call last):
File "C:\Users\Desktop\raycast\testing.py", line 285, in <module>
main()
File "C:\Users\Desktop\raycast\testing.py", line 50, in main
surf, en = draw_sprites(surf, sprites, enemies, spsize, hres, halfvres, ticks, sword, swordsp)
File "C:\Users\Desktop\raycast\testing.py", line 276, in draw_sprites
spsurf = pg.transform.scale(sprites[types][cycle][dir2p], scale)
TypeError: integer argument expected, got float

I have not modified the code so I am not sure why it is doing this?

Thank you! :D

GregoryMark
Автор

hey i have a this part is broken when i run it and get close to monsters they run away

code -
for en in range(100):
enx, eny = enemies[en][0], enemies[en][1]
angle =
if abs(posx+np.cos(angle)-enx) > abs(posx-enx):
angle = (angle - np.pi)%(2*np.pi)
anglediff = (rot-angle)%(2*np.pi)
if anglediff > 11*np.pi/6 or anglediff < np.pi/6:
dist =
cos2 = np.cos(anglediff)
scaling = min(1/dist, 2)/cos2
vert = 300 + 300*scaling - scaling*spsize[1]/2
hor = 400 - 800*np.sin(anglediff)- scaling*spsize[0]/2
spsurf = pg.transform.scale(sprite, scaling*spsize)
surf.blit(spsurf, (hor, vert))

CXLCaleb
visit shbcf.ru