Tiles and Sprites in Pygame - Adventure Game Part 1

  Рет қаралды 2,885

Alexander Farrell

Alexander Farrell

Күн бұрын

Пікірлер: 22
@alanamantinodasilva4362
@alanamantinodasilva4362 3 ай бұрын
i did your code for complete, but the map is not proporcional when i run, and when i press the keys, the game have a delay and freeze if i switch from one direction to another one, but the most worst, is when i move the mouse the player move faster and dont delay...
@alexanderfarrelltech
@alexanderfarrelltech 3 ай бұрын
Oh I see, I'll see if Pygame can sometimes delay with user input. Would you mind pasting the update function from your player.py file?
@yugrajsingh6237
@yugrajsingh6237 3 күн бұрын
Trees aren’t duplicating. It’s frustrating. First code works Then the second import treees doesn’t 😢😢
@mrpotato1043
@mrpotato1043 9 ай бұрын
I currently have a functioning game but i now want to make specific tiles not accesible for my player. To make him only able to walk on land but not on water? but i cant seem to find anything thats working. Could you help me?
@alexanderfarrelltech
@alexanderfarrelltech 9 ай бұрын
Hi, absolutely. In another video, we go over how to implement physics in the game, to make it so players can't walk on water. I'll link to this video here kzbin.info/www/bejne/fHurf4KXrbBpqbM Feel free to watch, or take a look at the source code and use if needed. If you have any other questions feel free to ask!
@anthonydrakefordshadow
@anthonydrakefordshadow 3 ай бұрын
Hard to believe it’s been 6 months already 😅
@alexanderfarrelltech
@alexanderfarrelltech 3 ай бұрын
Oh I hear you. Time has gone by so fast.
@anthonydrakefordshadow
@anthonydrakefordshadow 10 ай бұрын
I like the way you break things down. I hope you will be making more content. I have been using another series of videos to make my tile map adventure game. If I share the video do you think you can help me scale my player sprite? Right now my player size is confined to within the size of the tiles.
@alexanderfarrelltech
@alexanderfarrelltech 10 ай бұрын
Thank you that is very kind. Feel free to link that other video. To scale a player in pygame, we need to set the transform. I may cover this in another video, or work this in. Say you have an image called "image" You load as such: image = pygame.image.load("image.png") Then you can scale it to a certain size by setting it again with the following: image = pygame.transform.scale(image, (150, 150)) It will scale the image up or down to 150x150 pixels, without needing to actually modify the image itself. If you run into any issues with it, please let me know and I'd be happy to help.
@anthonydrakefordshadow
@anthonydrakefordshadow 10 ай бұрын
@@alexanderfarrelltech I made it through video one but once I include my player sprite with video two he is crammed between the tiles. kzbin.info/aero/PLywhTYI3VhfJCkp_aQXFj_8-Ac496LmUm&si=EtsMzWl3H_2zp70k This is the playlist. I will give the recommendation you provided a spin after work, thank you. Also if you can make your player jump I would just switch over completely. Your tile map is so much more interesting, and I really appreciated the teleport feature!
@Nubbley
@Nubbley 3 ай бұрын
i copied all the files from github, added them to my game. the only issue i have come across is that there is no dirt/water/grass showing. the trees are laid out but its just the green clear background behind the trees and not the environment drawn out.
@alexanderfarrelltech
@alexanderfarrelltech 3 ай бұрын
It could be a couple things: 1. Was a tile map created? 2. Is the draw method of the tilemap being called? Let me know if you have any questions, I’d be happy to help.
@Makspython69oleynik
@Makspython69oleynik 6 ай бұрын
Hello Alex your lessons is very good and informative thanks for it. Could you recommend me some books or lessons to learn python
@alexanderfarrelltech
@alexanderfarrelltech 5 ай бұрын
Thank you @Makspython69oleynik! You know a great resource is O’Reilly books. I don’t sponsor them or anything, but you can read lots of technical books such as ones in Python on their website. I believe they may still have a free trial. W3schools is good for getting a quick introduction to Python. W3resource is good if you want lots of practice exercises to do. Once you’re comfortable with the basics of Python, learn about various external modules. Learn how to build web applications with Python using either Django or Flask (or try both). Learn how to build games with PyGame, such as with these videos. Learn Numpy, Pandas and Matplotlib for data science. Build desktop applications with TKinter. Learn how to automate things on web pages with Selenium. The more modules you learn, the more you can do with Python right out of the box. There are a ton of other KZbin channels too that have great content.
@anthonydrakefordshadow
@anthonydrakefordshadow 10 ай бұрын
I would like to use your videos because the videos I am using are from a few years ago and there is no feedback for questions BUT it is the only videos I have found that teach “jump” from a tile. Can you map a video that includes jump in continuation to this video? Please and thank you 🙏
@alexanderfarrelltech
@alexanderfarrelltech 10 ай бұрын
That is very kind. I will see about planning a platformer video in the future. It may be based on the collision detection video as part 4 of this series. Thank you for watching and for the encouragement, I hope these videos are helpful.
@anthonydrakefordshadow
@anthonydrakefordshadow 10 ай бұрын
@@alexanderfarrelltech I would like my player to perform jump in your current top down view, not a side view platformer if that makes sense? I sent the playlist I found that includes top down jumping, it is in video 10 of the link below. kzbin.info/aero/PLywhTYI3VhfJCkp_aQXFj_8-Ac496LmUm&si=EtsMzWl3H_2zp70k
@alexanderfarrelltech
@alexanderfarrelltech 10 ай бұрын
@anthonydrakefordshadow Oh definitely. What you could do is add an altitude field to your sprite class, then when you draw the sprite, subtract the altitude from it. I've included a link to this modified sprite class for making your character jump. Observe lines 16 and 28 which add altitude to the sprite. gist.github.com/AlexanderFarrell/df7cf7b3cfec971574320d67b9ae0973 Then in your player class, you could also keep track of the jump speed. If the player presses space, and the altitude is 0, then set it to 5, and have the player then jump from there. I've included this as well, observe lines 26, and also lines 34 through 40. gist.github.com/AlexanderFarrell/3373572fa82cd7542df120d370b6f27c In addition, you might want to draw a shadow. Maybe create a separate shadow object which follows the player's feet as well. Hope this helps, if you run into issues with it let me know.
@anthonydrakefordshadow
@anthonydrakefordshadow 10 ай бұрын
@@alexanderfarrelltech You are the MAN!!! 🎉 I gotta go find you some Subs my guy!
@anthonydrakefordshadow
@anthonydrakefordshadow 10 ай бұрын
@@alexanderfarrelltech where have you been my friend 👋
2D Camera in Pygame - Adventure Game Part 2
8:28
Alexander Farrell
Рет қаралды 689
Optimizing with "Bad Code"
17:11
Kaze Emanuar
Рет қаралды 212 М.
Spongebob ate Michael Jackson 😱 #meme #spongebob #gmod
00:14
Mr. LoLo
Рет қаралды 9 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 22 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 9 МЛН
Can Windows XP Run Minecraft 1 21?
44:40
ChrisPro
Рет қаралды 801 М.
Pixel Art Sprite Style Discussion (...and compilation of all my sprites!)
5:42
Writing a game the hard way - from scratch using C. #1
34:20
NCOT Technology
Рет қаралды 127 М.
How A Steam Bug Deleted Someone’s Entire PC
11:49
Kevin Fang
Рет қаралды 999 М.
How Optimizations made Mario 64 SLOWER
20:41
Kaze Emanuar
Рет қаралды 431 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 591 М.
Linux is a MAJOR Rabbit Hole
36:40
TechHut
Рет қаралды 667 М.
Is Computer Science still worth it?
20:08
NeetCodeIO
Рет қаралды 332 М.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
PlayWithFurcifer
Рет қаралды 1 МЛН
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 338 М.