Sprite Stacking in Python and Pygame
HTML-код
- Опубликовано: 1 июл 2024
- Sprite Stacking Pygame Tutorial on Creating a Pseudo 3D Game Engine in Python.
Assets:
drive.google.com/file/d/1hphi...
All code from video:
drive.google.com/file/d/1jyYs...
Github (with collision and shooting)
github.com/StanislavPetrovV/S...
MagicaVoxel:
ephtracy.github.io/
Editor for SpriteStacking (found on github):
github.com/antopilo/SpriteSta...
00:00 Intro
01:52 Initial Setup
03:09 Sprite Stacking
09:36 Caching System
13:37 Player
19:26 Scene
21:19 Y-sorting
23:37 Outline
25:30 Entities and Animation
29:38 Transparency
#coderspace #pygame #spritestacking
This channel is so underrated
so true
It's absolutely fantastic! Pacing & content is perfect.
You quickly gained my sub! Wow what a video! Kept me entertained, focused, it was clear cut. That was pure magic!
Amazing stuff, i love sprite stacking graphics and i'm definitely gonna use this for a game! Your channel is a fantastic source for python game developers, keep it up!!
Really, really incredible tutorial! Keep up the awesome stuff!
I've shared your videos with my computer graphics professor and he was impressed, especially dealing with niche topics like these. Great stuff, man. Keep it coming.
This video is 🔥 heat🔥 keep up the great work
Dude, you are great! I am glad i just found your channel :)
Thanks for the video. Nice 3D effect 👍and thanks for sharing the code 👌👍💪
Incredible work. You are talented!
Very Impressive! Good work
hey, I just found this hidden gems, thanks for making this channel, keep it up !!!
This is incredible, thanks for sharing
omg this channel is so great, very helpful
I'm literally studying Python Fundamentals, (and basic stuff) and I looked up alot of your videos, and I'm like: How much dedication and discipline does this man have to know and do all of this.
Like you've also been in Hello World and to reach stuff like this must feel really nice. But sadly i barely understand most of the code, like when there are some 3D or Open GL stuff, is it really hardcore math and formulas behind the scenes, how are you not getting confused at some point, like how is all of this learned xd, anyway thanks for making these!
You are amazing! Tnx man
Man, this video is awesome!!!
man you are my hero
It looks very nice!!
spasiba brat, siljna pomogaet
This is an amazing technique to me, I find pseudo-3D to be something very interesting, reminds me of the hacks and techniques used for old 2.5d games like doom and duke nukem
great video
I have been have been learning and experimenting with Python and Pygame myself and these videos are great! I would like to suggest a video on 2D lighting and sprites with normal maps which is similiar in being a 2.5D kinda look. One place where i saw this was the application Sprite Lamp and i think it would be cool if you could implement in Python/Pygame. Thank you for the great videos/info.
So Nice .
this video opens my dog eyes
Super Amazingggggg
Amazing!!!
Really hot stuff man! But is there anyway to input enemy AI into the dancing kitty entity?
oh serius its genius!
This is cool AF but it'd be even cooler if there was a human voice
Very cool job, thank you! Author, do you think it's possible through PyGame (or another Python library) to make a game in the spirit of The Final Station and put it out for commercial use?
yes Pygame is quite suitable for such 2d games
why do so many people say pygame is bad for creating games
I really like this video, but I wish you went over collision. this video is really cool regardless!
Cool!
Super
damn i wantt to go back to python now
That looks incredible, but I can definitely see myself getting a headache after half an hour.
i don't understand python at all, in fact my first programming language is java, and now i am a flutter enthusiast. I dont prefer dynamic lang, confusing to me, really hard to read, what this function return, what data type you get from this variable, what about null safety, ..etc. BUT, i love the math and logic behind your vid. is amazing. i will rewrite it in dart for sure. in the end syntax dont matter right? math always wins. thanks for the video, great work. keep it up
This game is insane. Looks like pokemon in gameboy
First of all, great work! I had no idea there is so many different ways of making 2D games pretend to be 3D!
Second: Are there some commercially available games using this Sprite Stacking method?
marketplace.yoyogames.com/assets/7494/lucid-engine-pseudo-3d
@@CoderSpaceChannel thanks, but how about real games made in this way, that we can play, on Steam or any other platform, are there any?
@@grzegorzkozinski2308 I have not researched the market, I am interested in the technology itself and the resulting graphic effect. But there certainly are such games.
nice vid bro, you are a genius,
can you do a video about 3d procedural generation using opengl and noise
Yes, I was planning to make a video about it in the future.
How would one go about animating spritestacks? Implementing magicavoxel animations to things such as trees and maybe player and entities.
Amazing, I love it when a new vid comes out.
One question: how... How could I add shadows?
I had the thought of baking a dark alpha texture to the bottom image and depending on if there was anything above setting the alpha. However, this means that the light appears to always be above it and so:
I was wondering if there was a way to have some sort of source lighting effect?
The most straightforward approach is to draw a shadow as the bottom layer for each sprite. Then the shadow will rotate at the same time as the world
@@CoderSpaceChannel yeah, that's what I thought about, but I was wondering if there was a way that it could be projected out at all in real time?
@@icotwilight Then for this it is better to use GPU acceleration, for example, the Pyglet or Arcade module
As a beginner coder, with rusty math skills, I'm struggling to understand the logic of this code (couple of my vars named different but same logic):
discrete_angle = -math.degrees(self.player.angle) // self.viewing_angle + self.rot
self.angle_key = int(discrete_angle % NUM_ANGLES)
...What I don't get is why the negative in the math.degrees conversion? After some laborious study I can only think of the different signs put in front of the mod operator. if discrete_angle is increasing from zero, the angle_key increases from zero; OTOH if discrete_angle is decreasing from 0 (increasing in negative direction), then angle_key starts at 0, jumps to the last element (NUM_ANGLES - 1) then decreases from there (NUM_ANGLES - 2, ...). What I'm struggling with is coding this logic and how it translates to the screen.
Wrapping my head around angles in pygame is a little frustrating ngl!
Also I note that python truncates the int operation toward negative infinity; does this have something to do with the logic? For example, at a small angle, 0.0165 rads, using the negative is the difference between outputting 0 and outputting -1. Anyways, thanks if OP or anybody can assist this rusty brain of mine.
Can you make an tutorial for an Racing game with AI racers, cop chases and an campaign aka career?
It's so cool. Can I know your PC specifications?
Laptop Ryzen7 5800u 16gb ram Vega8 AMD graphics
I like you
When I ran the code at 6:38, I got the error "TypeError: can't multiply sequence by non-int of type 'pygame.math.Vector2'". Can anyone help because I followed the tutorial very closely, I don't think I'm missing anything and, I've wasted a good amount of time now.
how to get y_offset for everry sprite?
hi, thank you.. btw how pygame those days i heard its no longer support or something
Pygame is fine. Although another development branch appeared - Pygame-CE
Would it perform better if the sprite rendering part was written in python opengl? Then I guess there would be no need to use caching
yes it will be better, but then you will have to abandon all the functionality of Pygame, except for Opengl initialization, keyboard event handling and sound
Hey, how would I save the sprites to the disk?
Hey Coder Space! How can i texture the floor in ray casting? i very need that.
you can use the technique from mode 7 video but you need to find the correct formula to calculate the FOV
@@CoderSpaceChannel thanks coder space
Loved this Tutorial ! Followed & Added quite a bit: ruclips.net/video/GvqRD7GCnQQ/видео.html
Modified the code & then extended it - first *caching* (needed), multi-channel audio with f/x , collisions w/animations triggered on target, interactions & other action triggers, other action/adv type game logic. Thanks so much for posting your excellent work "Coder Space"!
nice!
Question, is diablo 2 made the same way?
diablo 2 is just an isometric 2d game
May I follow this tutorial for my commercial use game?
if you want to use the source code, then just make a mention of the original
@@CoderSpaceChannel k thx dude
What's the IDE name
PyCharm