PyGame Level Editor Using Tilemaps in Python - Tutorial

Поділитися
Вставка
  • Опубліковано 30 лис 2024

КОМЕНТАРІ • 174

  • @tgk21
    @tgk21 3 роки тому +30

    Hey Russ I’m 13 trying to create apps early and your teaching is wonderful....your teaching me so much about coding and what you do for people is so kind and wonderful keep u the awesome work❤️❤️❤️

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому +3

      Thanks a lot! I'm glad the videos are helping 🙂

  • @Pixelaze
    @Pixelaze 3 роки тому +6

    Thank you so much for sharing! I've been trying to get into game development for the longest time. Seeing your videos gave me that final push.

  • @khargos7602
    @khargos7602 8 місяців тому +1

    I was getting a little lost around 1-hour in. Then, you said it might make more sense if you ran the code, and the program hit an error immediately, so I got skeptical, but then your combination of print statements and examples really cleared the confusion. It was the part where you were correlating the mouse position to the tile grid, by the way.

  • @johnandlisalinderman6238
    @johnandlisalinderman6238 3 роки тому +8

    you put a lot of time in this and I am grateful even when you C&P code you still explain you are defiantly a good teacher my friend

  • @Narriz
    @Narriz 2 роки тому +6

    Love the detail and structure in your explanations. Good job.

  • @evagok3698
    @evagok3698 2 роки тому +3

    Thanks a lot! I have completed this video too and I learn a lot again. You are really good at teaching. I am looking forward to finish the other tutorials

  • @notnaix
    @notnaix 3 роки тому +1

    just completed ur pygame scrolling shooter game tutorial and im now here to learn how to make my own levels. man ur lessons are really great and is helping a lot of people most especially first timers like me. thanks russ!!!

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Awesome, glad to hear it is helping!

    • @notnaix
      @notnaix 3 роки тому

      @@CodingWithRuss I was wondering, how do i share my game to friends who dont have python installed? Is there a way for me to host it in a website so they can play it there? Would love to hear back from u

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      @@notnaix You can use pyinstaller to do that. I've only done it a couple times and it may take a bit of troubleshooting to get it to work but that's one way that I know of.

    • @notnaix
      @notnaix 3 роки тому

      @@CodingWithRuss yep, I am using pyinstaller but I always get the error saying it failed to execute script. I’ll have to figure out how to get this to work

  • @vincent10kd
    @vincent10kd 2 роки тому +2

    Thanks a lot! I adapted this level editor to suit my needs and use it now, it's perfect.

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      Nice! I only really made this as a tool for my game so it's cool to see others are adapting it and modifying it for what they need

  • @JohnnyThe3rd_
    @JohnnyThe3rd_ 3 роки тому +5

    I have a question, every time I use button.Button(), it gives me this error AttributeError: module 'button' has no attribute 'Button', does somebody know how to fix this?

    • @shido7068
      @shido7068 2 роки тому +1

      I have the same problem

    • @Rick426_
      @Rick426_ 2 роки тому

      same problem here. :(

    • @agnes2864
      @agnes2864 6 місяців тому

      have you created the button module to be imported?

  • @LimitzKL
    @LimitzKL 3 роки тому +4

    a custom level editor gui, insane man! keep it up

  • @nimrodvecsei4725
    @nimrodvecsei4725 7 місяців тому +3

    Thank you Coding Whit Russ, your videos are a lot of help to me so.. Thank you!

  • @anypuppet
    @anypuppet 3 роки тому +7

    I love your videos! You are a great teacher. Thank you so much for sharing your knowledge.

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Thanks a lot! Glad to hear these videos are helpful

  • @mohamedhasifkh4822
    @mohamedhasifkh4822 3 роки тому +9

    proud moment when you realize his mistakes before he realizes " I am beginning to understand"

  • @gamesbyar5323
    @gamesbyar5323 Рік тому +2

    Amazingly easy to follow 👏
    Thank you!

  • @aronaza123
    @aronaza123 3 роки тому +2

    This will be really useful! Thank you so much, love all your tutorials

  • @orangesidny
    @orangesidny 3 роки тому +2

    Luv your videos i watched ALL of it about 20 times

  • @shido7068
    @shido7068 2 роки тому +1

    apparently a lot of the functions i am unable to say .draw, like save_button.draw(screen) or load_button.draw(screen) or i.draw etc
    Please help me fix this

  • @jadenhanson7070
    @jadenhanson7070 3 роки тому +1

    Yea that is a good idea you should add that Ross

  • @TRICKKZZZZ
    @TRICKKZZZZ 3 роки тому +3

    tile_button = button.Button(SCREEN_WIDTH + (75 * button_col) + 50, 75 * button_row + 50, img_list[i], 1)
    AttributeError: module 'button' has no attribute 'Button'. help pls

  • @quicklimeolanrewaju6568
    @quicklimeolanrewaju6568 Рік тому

    Hi. Great tutorial.
    I just want to know if you can use levels created in this way for games created using languages different from python/pygame

  • @chrischou9068
    @chrischou9068 3 роки тому +1

    Best game dev Tutorial, so inspiration.

  • @karl-heinzskywalker387
    @karl-heinzskywalker387 3 роки тому +1

    I usually don't give likes but I give them to every video of this channel

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Thanks a lot! :)

    • @karl-heinzskywalker387
      @karl-heinzskywalker387 3 роки тому

      @@CodingWithRuss I have to thank you. Why don't you put a Donate Option at your GitHub, I'm sure some of your viewers will support you.

  • @Balck_ant001
    @Balck_ant001 11 місяців тому +2

    insane!

  • @xxxxxx-rt3rq
    @xxxxxx-rt3rq 3 роки тому +1

    I learnt a lot from this tutorial :) I will use your tips and tricks with my future programs. Thank you very much for this tutorial!

  • @big123lak
    @big123lak 11 місяців тому

    bro holy shit your a beast , wtf thank u so much man im working on just practicing stuff and being able to make my own stuff too im just trying to aim for 10k hours of coding ive been going for about a month I started really basic stuff this stuff is great I found this from the platform game I only did the part 1 once I seen the level editor it looked very similar to code I did for a tic tac toe game and I looked back at it and realized I couldnt write it again without looking at anything so im gonna work on this I think then go back to the other vid

  • @soupnoodles
    @soupnoodles 3 роки тому +2

    This is great! However i feel a bit sad that when i tried making something like this, from your previous level editor for the platformer game, i failed. So really what im doing is just using your code and adjusting it to my needs :(

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Thanks! Yea that previous editor was a bit more basic so I had to start from scratch when i made this one.

  • @dominicballinger6536
    @dominicballinger6536 2 роки тому

    Hey, I'm trying to make a Tapper clone, and I want to make a list of potential points in a grid, which is only a section of the screen, not the whole thing, where customers/patrons can spawn. So, how would I go about making this list or even a grid like that?

  • @scotturquhart4380
    @scotturquhart4380 10 місяців тому +1

    Thank You,
    You're an Excellent teacher. Easy to understand and follow.

  • @ericchhun8116
    @ericchhun8116 3 роки тому +1

    i.draw() didn't work for me. It gives this error AttributeError: module 'button. tasks' has no attribute 'draw'. anybody knows how to fix this problem?

    • @shido7068
      @shido7068 2 роки тому

      SAME PROBLEM HEEELP ME

  • @ccc00007
    @ccc00007 2 роки тому

    At 35:00 it says module button has no attribute ‘Button’ can you help me

  • @555amry
    @555amry 9 місяців тому

    hello, what if i want to make a boss that is bigger than one tile

  • @adriantokarczyk8445
    @adriantokarczyk8445 3 роки тому

    question if i add another class ( collecting coins and with the counter on the screen ) can i use the item box just add as another 'box' ???

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Yea that should work. I tried to make the item boxes flexible so they could be any type of collectible item. You just need to code in your score counter so it increases when you collect that coin item box

  • @Arthur-uy4wr
    @Arthur-uy4wr 3 роки тому +1

    AttributeError: module 'button' has no attribute 'Button' can you help me ?

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      You have to download the button.py code from the github link

  • @technicalenergizer3736
    @technicalenergizer3736 3 роки тому

    please help me my computer showed error "window is show large"

  • @shahadathosen8111
    @shahadathosen8111 3 роки тому +1

    Thank you sir for your new tutorial.

  • @kydung5378
    @kydung5378 3 місяці тому +1

    Thanks for tutorial, amazing ....🥰🥰🥰

  • @oZink-
    @oZink- 3 роки тому

    how do I put the folders in? in what order pls get back to me

  • @orangesidny
    @orangesidny 3 роки тому +3

    Like not just move the Background but be able to move the Tiles as well

  • @MercGoBrrr
    @MercGoBrrr 24 дні тому

    Thanks a lot for the tutorial, i made my own levels with the help of your level editor but how can i use the map i made for my actual game?

  • @jakubmaruska3225
    @jakubmaruska3225 2 роки тому

    hi I try to use your function for loading data so I write everything like you, but I got this error:
    world_data[x][y] = int(tile)
    IndexError: list index out of range

  • @panoskent6682
    @panoskent6682 2 роки тому

    hello there! Really helpful tutorial...However when i try to create a health,grenade or an ammo box it shows them but they aren't actually created...Any solutions?

  • @prajjwalpathak2718
    @prajjwalpathak2718 3 роки тому

    Sir, currently we are working with square tiles, how to work with angular tiles, like edges of ground or ramps which are bottom half of a square

  • @orangesidny
    @orangesidny 3 роки тому +1

    I could not find that in the Video
    Or i mist it please can you add a Time Stamp for it

  • @advancedcuber9226
    @advancedcuber9226 3 роки тому

    hey its showing button module has no attribute Button...pls tell I am so tensed

    • @Luke-bo4cv
      @Luke-bo4cv 3 роки тому +1

      Im pretty sure he said in the video he made a tutorial on making that module, it doesn't already exist im not sure if that helps though

  • @advancedcuber9226
    @advancedcuber9226 3 роки тому

    Hey I have a problem ...just tell me i have done everything like yours ...but cant convert it to csv file format....
    I have resolved everything ...I have changed this to a level editor for any game ...it asks the bg and other imgs ...then generate to form cols and make an editor ...

  • @imdmotcm8953
    @imdmotcm8953 3 роки тому +3

    Thanks brother!

  • @crumstopher
    @crumstopher 3 роки тому

    Do you have/will you be making a video explaining how to assign properties to each tile such as collision, placing NPCs/enemies as tiles, and using tiles to designate a much larger sprite like a house or shop?

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому +1

      This editor does those things but in a simplified way. You can add tiles that can be used for collision and others that are for decoration, same with enemies. It doesn't have anything for buildings though, that could be a pretty useful feature if I was adapting this for an adventure/rpg game

    • @crumstopher
      @crumstopher 3 роки тому

      @@CodingWithRuss Do you think you'll ever make a video adding buildings to the level editor like upgrade shops? One way I could think to do it is to have several tiles like a jigsaw puzzle and put them together on the tilemap and add a trigger that transitions to a shop level but that sounds really inefficient, especially when it comes to the inside of the shop

  • @tgk21
    @tgk21 3 роки тому

    ive downloaded the button but when i import it doesn't work?

  • @aywhat.3133
    @aywhat.3133 3 роки тому

    Hi, im using this level editor, but i want to change screen_width and screen_height to 1000. What else would i need to change so everything fits? (my tile sizes are 21x21 btw)

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      The main thing that matters is the number of rows and max_cols as that is how your data will be exported from the level editor into your game. So the rest of the sizes you can tweak to make it user friendly. The tile_size variable calculates automatically so you shouldn't need to change anything other than the screen_height and screen_width

    • @aywhat.3133
      @aywhat.3133 3 роки тому

      @@CodingWithRuss thanks. Also, at line 37 (31:15) I’m trying to use the python formatting function, the f but I keep entering the normal f, not the squiggly one like yours. I think because of this I keep getting the “no such file or directory” error. How do I get the f to work? (Sorry for the simple questions, this is my first programming project 🙂)

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      @@aywhat.3133 You may be using an older version of python, which does not support f string formatting, which is what I am doing when I put an "f" at the start. Try updating your python installation and it should resolve it. Otherwise you can do it with the .format() method, but the way I have shown it is neater.

    • @aywhat.3133
      @aywhat.3133 3 роки тому

      @@CodingWithRuss Yeah finally got the level editor to work completely. So how would i use it within the 2d platformer code? (i'm following your tile based platformer tutorial)

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      @@aywhat.3133 The tile based platformer had its own level editor, which was a bit more basic. You could try using this one by setting the rows and columns to 20 x 20 to match the platformer. And make sure the data is exported with pickle and not csv because the platformer is designed using pickle

  • @blueboys123
    @blueboys123 3 роки тому

    Hello.. please .. for import button it says there is no such module - no module named "button" how is that?

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Did you download the separate python file called "button.py" from the github link?

    • @blueboys123
      @blueboys123 3 роки тому

      @@CodingWithRuss Oh.. noo.. thats the thing.. Thank you

  • @mikewakednimri1064
    @mikewakednimri1064 Рік тому

    Hello, I tried it but I have one problem..
    The levels are in a csv format so I need a csv debugger but can't find one
    Are there any solutions for this?

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      You can open csv files with excel (if you are on windows). I think even notepad will open them. I'm not sure about iOS but there would be an equivalent.

  • @aresgames8586
    @aresgames8586 3 роки тому

    how i can write to txt file without commas? only numbers like this 00001110000... ?

  • @krishivgoel2122
    @krishivgoel2122 10 місяців тому +1

    Thank you soo soo much dude You just got a sub

  • @nayunayu4265
    @nayunayu4265 2 роки тому

    i'm getting an AttributeError: module 'button' has no attribute 'Button'
    every time i do the tile_button = button.Button line
    how can i fix this?

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому +1

      Sounds like it can't find the file. Make sure the button.py file is in the same folder as your main code.

    • @nayunayu4265
      @nayunayu4265 2 роки тому

      @@CodingWithRuss i'm still confused as to where to get the button.py file, do i just follow your tutorial of this and save it as a separate file so i can import it to the main code?
      ua-cam.com/video/jyrP0dDGqgY/v-deo.html

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому +1

      @@nayunayu4265 It's on my github repository for this project. Should be linked in the video description

  • @CC-zr6fp
    @CC-zr6fp 3 роки тому

    Great tutorial! I have a question on switching between levels. When I switch to a new level to draw, it keeps the previous level layout. Is there a quick way to redraw a blank screen or do we need to erase everything first? EDIT: I did add a try statement to the load button as it would close the program out if I did not have a level for it saved. Only downside is it deletes the bottom layer so you have to do it by hand. But that is good for a water level lol.

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому +1

      Hmm that's a good point! I guess as I made this for my own use, some of the user friendliness didn't get prioritised :)
      Having a quick look at the code now, it may be simple enough to reset the world_data list when you change level numbers using the code between lines 58 to 66.

    • @CC-zr6fp
      @CC-zr6fp 3 роки тому

      @@CodingWithRuss Awesome, that works! Thanks!

  • @anntakamaki1960
    @anntakamaki1960 2 роки тому

    Ahh, so when scrolling we don’t change the camera. Rather we change position of everything else.

  • @burbulinadas12
    @burbulinadas12 3 роки тому +1

    Another good one buddy! Thank you so much.

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому +1

      Thanks a lot! Had a few requests for this one so hopefully it is useful. I didn't think it would be as long as this though so I may need to split it into a few separate videos!

    • @burbulinadas12
      @burbulinadas12 3 роки тому

      For me it works. UA-cam saves were I last watched your video.
      Of course splitting it up into parts maybe the way to go.
      Everytime I finished one of your tutorials I try to add my personal twist to it to better understand the code.
      How far do you think pygame can go when it comes to game development? Is it something that people might use for learning python or can it be something for publishing indie games?

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      @@burbulinadas12 I know there are some impressive looking games that have been made in pygame....like this Terraria clone: www.pygame.org/project/3451 so it is doable, but you have to make everything from scratch pretty much so I'm not sure it's a great choice for serious game dev. I actually got into it myself because I wanted to learn Python!

  • @sindhubiju2352
    @sindhubiju2352 3 роки тому

    How do i use this code for the platformer game

  • @saadedi75
    @saadedi75 2 роки тому

    thank for all video
    what the software you use to create platforme
    thank you for your answer

  • @jeni8595
    @jeni8595 2 роки тому

    Sir which IDE are you using for coding??

  • @tizzywizzy
    @tizzywizzy 3 роки тому +1

    Really useful video

  • @andeemengaming5000
    @andeemengaming5000 3 роки тому

    i had a question; how do i load this data into a game (the images and their pos)

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      I made this for a specific game, which loads the data in and creates a level from it. You can see the code & tutorial for it here: ua-cam.com/video/DHgj5jhMJKg/v-deo.html

  • @ProRylan
    @ProRylan 3 роки тому

    iv watched most of this and still watching, Is there a way to put all your own title in the Level editor?

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Yea sure, you can replace the images in the folder with your own ones

  • @boredguitarist27
    @boredguitarist27 3 роки тому +1

    Dude, thank you so much!

  • @marcusberge8378
    @marcusberge8378 2 роки тому

    This is just amazing!

  • @dcdondon
    @dcdondon 3 роки тому

    Hi! Very nice tutorial.
    I would like to load files whose names contain strings (i.e. 0A.png, B4.png and so on.)
    If I use img = pygame.image.load(f'[myfolder]/{x}.png') I get an error (FileNotFoundError: No such file or directory.).
    The solution could be renaming all of them only with an integer value (indeed it works) but I'd like to use their original names.
    I could achieve that? Thanks in advance.

    • @muhammadumar7649
      @muhammadumar7649 3 роки тому

      Why over complicate something that works efficiently on its own. The image names don't show up on the screen anyway so it wont matter as the output would be the same. And the folders they are in help keep them tidy.
      Still, if you insist on wanting to name them, you could make an additional for loop and a dictionary. So first, in the dictionary u would load all the image names.
      Then you run a for loop for each of the items in that dictionary and then the output for each iteration of the loop would then become the variable we are using in this video ("X").
      And you can't make it much more simpler than this if you want to have custom names of the images.

  • @Muhammad-wu7ht
    @Muhammad-wu7ht 11 місяців тому

    Amazing Content!🤗

  • @nathanarshynov5487
    @nathanarshynov5487 3 роки тому +1

    Amazing vid but can someone tell me what the code for the button class is?🤔

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Did you find it? It's on github with the main code

  • @SUp641
    @SUp641 3 роки тому

    14:29 You can just say if scroll_left:

  • @earljasperaquitania5915
    @earljasperaquitania5915 3 роки тому +1

    Thank you!! keep it up!!

  • @gabrielverasguitar
    @gabrielverasguitar 3 роки тому

    Cara sou brasileiro não entendo muito bem o ingles mas seu video foi tao bom que eu consegui entender o tutorial!

  • @aniketmishra71
    @aniketmishra71 3 роки тому +2

    Thank YOU!!!!!

  • @kewtomrao
    @kewtomrao 3 роки тому

    Can u tell me why u use pygame instead of unity?

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому +1

      I wanted to learn Python and I like making games so that's why I went with PyGame. I would like to try Unity at some point though

  • @tgk21
    @tgk21 3 роки тому

    Your an awesome person what you do is amazing.....I’m having a little problem with importing button though and I have downloaded it

    • @tgk21
      @tgk21 3 роки тому

      nevermind i got it to work :)

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      Glad to hear it. That was quick! :)

  • @saadedi75
    @saadedi75 2 роки тому

    Sorry, I asked the wrong question.
    I’m talking about the software for creating tilemaps.
    the same as you.
    sorry for the disturbance

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      You mean the images? I downloaded them online for free.
      Or do you mean the software for creating the levels themselves? I made that myself, it's what this tutorial is for

  • @Adthi_playz_vip_god
    @Adthi_playz_vip_god 4 місяці тому

    how to use his tilemap

  • @lead1320
    @lead1320 2 роки тому

    How do you play the level?

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      The level editor makes levels for my shooting game, which is in another tutorial: ua-cam.com/video/DHgj5jhMJKg/v-deo.html

  • @orangesidny
    @orangesidny 3 роки тому +2

    YO whats up
    I have been Trying SO SO HARD
    asking So many people
    Made about 25 tickets in 5 different discord servers.
    Please can you make a video
    Of if a player moved then the tiles/ world will move
    So you can have a bigger word on a smaller
    Screen As I have seen you on this Video at the start.
    Or if you cant do that can you please add your code for that game in the link in your GitHub Please

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому +1

      Hi, sure that is a feature in the game I am currently making and I will be uploading the tutorials for that soon!

    • @orangesidny
      @orangesidny 3 роки тому +1

      @@CodingWithRuss Thank you SO much
      I am going back to school in 1 week
      So if you do relase it after a week
      I probs wont be able to watch it
      BUT it will AMAZING TO see how you do it.
      You should also make a discord Server
      Luv your Vids Keep it Up...

    • @orangesidny
      @orangesidny 3 роки тому +2

      @@CodingWithRuss I am Subed Btw
      Sorry I forgot to do that

    • @CodingWithRuss
      @CodingWithRuss  3 роки тому

      @@orangesidny Thanks! :)

    • @orangesidny
      @orangesidny 3 роки тому +1

      @@CodingWithRuss YOu do not know how long I have been trying to add a Camera
      I have joined like 15 discord servers 1000 Msges and about 50 dms to people
      And about 50 Code Backups
      I DONT GET HOW TO DO IT
      ANd its driving me INSANE
      If you know how to do it
      Please msg me on discord
      orangesidny#7030

  • @orangesidny
    @orangesidny 3 роки тому +1

    Please you do not know how useful it would be

  • @TheSteelJackal
    @TheSteelJackal Рік тому +1

    Hey Russ, I've been following along with this tutorial for a while now, just wanted to give you kudos for putting this altogether!
    I have a question regarding a little bug I caught at ua-cam.com/video/xYhniILN6Ls/v-deo.html (1:03:42) whereby scrolling left will actually slightly overshoot from the editor grid - I just wanted to ask if you or anyone else have had the ability to crack that little bug (which I've found is only really due to changing the scrolling speed!) and if you could share how you solved it!
    I'll reply to this comment in case I find a solution myself.

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      Thanks William. Good catch on that scrolling bug. It's been a while since I made this one but I think a solution would be to add a check to see if the scroll variable has gone below 0, i.e. gone off the left side of the screen:
      In the section where the scrolling is done after line "scroll -= 5 * scroll_speed" add this:
      if scroll < 0:
      scroll = 0.
      You may need to do the same for the right hand side scrolling as well. This should fix it.

    • @TheSteelJackal
      @TheSteelJackal Рік тому

      @@CodingWithRuss Cheers for getting back to me on this Russ, and very fair that it's been a while since you touched this.
      I've implemented a fix similar to that in my own version of this code, and I've been able to drill into the issue that it's a problem with the higher scroll speed (when holding down right shift).
      If the scroll value is of greater magnitude than the difference being tested for at the boundary (i.e. scroll is currently 5, and your next update to scroll will be -10), you will overstep the [0, MAX_COLS * TILE_SIZE] boundary.
      I'd have thought this was a problem I could address with forcing the scroll value to always be at the default scroll value when close to the boundaries, but none of my fixes have had the desired effect.
      Just sharing my findings in case anyone else is interested in this bounding problem 👍

  • @mojimoose9464
    @mojimoose9464 2 роки тому

    File "/Users/ella/Desktop/NEA/Main game2.py", line 69, in
    img = pygame.image.load(f"set/{x}.png")
    FileNotFoundError: No file 'set/[{x}.png' found in working directory , this is the problem and i can't seem to fix it

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      Sometimes this happens if you are not running the program from the game folder. Go to File -> Open Folder and open the game folder, then try running it again and see if it works.

    • @mojimoose9464
      @mojimoose9464 2 роки тому

      @@CodingWithRuss yep it works thank you but another problem came up stating pygame.draw.rect(screen, RED, button_list[current_tile].rect, 3) because the current tile is not defined

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      @@mojimoose9464 That's odd. What timestamp in the video did you get the error?

    • @mojimoose9464
      @mojimoose9464 2 роки тому

      @@CodingWithRuss 43:12

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      @@mojimoose9464 Did you define the variable first? Take a look at 41:30 onwards

  • @НикитаЧернов-е7к

    Why does it give an error "AttributeError: module 'button' has no attribute 'Button' " and how to fix it if the button library is added and imported?

  • @muhammedonurkaya5531
    @muhammedonurkaya5531 2 роки тому

    how do i fix this error bro?? tyy
    module 'button' has no attribute 'Button'

  • @anis5752
    @anis5752 10 місяців тому

    Thank you !!