PyGame Level Editor Using Tilemaps in Python - Tutorial | Part 3 - Adding Tile Buttons

preview_player
Показать описание
In this video, I explain the code for my updated level editor. This allows you to create and export levels to be used in your games. In part three I add all of the different level tiles as buttons

All the code and assets are on github:

Credits for assets:
Рекомендации по теме
Комментарии
Автор

why i have this error AttributeError: module 'button' has no attribute 'Button'

factsnhien
Автор

you just simply explain it, thanks and go on

hazemhazem
Автор

can you help me?
button.Button(...) is not working for me.
it says that module button has no attribute Button
whats the problem

pizzazip
Автор

Hey russ i have a trouble couldn"t find Button attribute in button

technicalenergizer
Автор

Hello, I know that your video lessons came out a long time ago, it’s not difficult to watch in 2021, but I’ll tell you how I have a problem :(. You said in the comments that you use the sublime code editor, but I use the PyCharm code editor, you enter: tile_button = button .Button(SCREEN_WIDTH + (75 * button_col) + 50, 75 * button_row + 50, img_list[i], 1) and everything worked for you 🤷‍♂️, I have a different code environment, I already have everything, I just entered everything through tkinter you imported the button right away and I need it .. and I did just that 1.import tkinter 2.space 3.import pygame 4 from tkinter import * and in line 5 I already have it and in the code environment itself only with a capital letter Button, if I write button Button then it gives an error, but if I just write Button it gives an error in the code [i] what to do please tell me 🙏🏻 maybe I could write the code differently, everything worked, but then an error occurred. At 6:36 minutes

ГерманАвраменко-кй
Автор

Can you help me?

I put "tile_button = button.Button(screen_width + (75 * button_col) + 50, 75 * button_row + 50, img_list[i], 1)"

When I try and run the program, it says "TypeError: __init__() missing 2 required positional arguments: 'size_x' and 'size_y'"

What happened?

Annie-mknm
Автор

The f string is giving me trouble.
img =
This gives me a filenotfound error. If I replace {x} with the actual filename the one tile comes in fine.
I'm on Windows. Any suggestions?

Ryan-cgwr
Автор

Hi can you help me ?
When i put "if i.draw(screen)" they said 'button' object has no attribute 'draw'

majsrohman
Автор

When ever I typed tile_button = button.Button(Win_Width + (75 * button_col) + 50, 75 * button_row + 50, crate or dirt or grass, 1) the uppercase Button was incorrect. If someone can tell me why that would be helpful.

nathanarshynov
Автор

Onother way of writing the button placement and more flexible:
button_list = []
for x in range(len(img_list)):
button_list.append(
Button(SCREEN_WIDTH + (1+2*(x % 3))* TILE_SIZE,
(1+2*(x // 3)) * TILE_SIZE,
img_list[x],
1
)
)

akramelomrani
Автор

Dear Russ thanks for ur all videos... They are really Marvelous...
I have problem with BUTTON... when I write:
'button.Button' the button with capital 'B' dosen't work. It backs:
module 'button' has no attribute 'Button'
I read all comments and download even ur code about class Button but it still dosen't work!!!
Please guide me...
TNK u so much

pouryabehtash