Python Maze Game Tutorial Part 5

preview_player
Показать описание
NEED HELP?

❤️❤️ SHOW SOME LOVE AND SUPPORT THE CHANNEL ❤️❤️

Click Join and Become a Channel Member Today!
Channel members can get preferential comment replies, early access to new content, members only live streams, and access to my private Discord.

Amazon Affiliate Links

Other Affiliate Links

LINKS

LEARN MORE PYTHON

LEARN MORE JAVA

#Python #Tutorial #Beginner
Рекомендации по теме
Комментарии
Автор

Excellent lesson! I can't thank you enough for what I'm learning from your channel. You are an excellent teacher.

teacherinthailan
Автор

I really like how you already wrote the code so unlike most youtubers who dont really explain what they are doing while they are writing it, you can just say exactly what it does and explain to better detail

whenpigsfly
Автор

Your videos are Great!! definitely worth the sub. keep up the good work :)

louisthompson
Автор

<----NOOB i added sound and pictures to my space invaders thank you again no tutorial has anything on this mans motivation to teach i pause the video like you refer to and it helps also i read the errors now more than i did so true us noobs never want to see the error or try to figure it out now i look forward to the errors and pausing the vid to finish another loop or add on

jeffcarpenter
Автор

if i want the treasures popping out randomly, what do i do? I already know i have to import random, put something like x and y as value names and give those values the coordinances of the screen, but i am too scared of putting it in the wrong place and I also know that everything is not perfect so i would love some help!!!
btw love the vids, I got started with python 2 weeks ago and I have followed your videos since

EthanJbleethan
Автор

hello sir i am having an issue with my code


Traceback (most recent call last):
File "C:\Users\Gamer\AppData\Local\Programs\Python\Python37-32\Lib\capstone.py", line 174, in <module>
if player.is_collision(Rubies):
File "C:\Users\Gamer\AppData\Local\Programs\Python\Python37-32\Lib\capstone.py", line 61, in is_collision
distance = math.sqrt((a ** 2) + (b ** 2))
NameError: name 'math' is not defined

lucasrespicio
Автор

Hi Christian,
Thank you very much for this great tutorial... However, I would like you to let me know whether you have a clue on this: is_collision is True only if the distance is <400... I'm a little bit puzzled, as my code is a copy of yours... :-/

fabricejaouen
Автор

I can't find the images, where are they??

chasenwang
Автор

My code was working coppied everything but now my character wont move anymore.

dronepilotsa
Автор

If I wanted to make more treasures(5 - 10) and make the game to end when all treasures are collestes could you help me with the code a bit thanks.

vultures
Автор

Hi Christian I got a bit of issue here. For whatever reason, if I have the while true: loop at the end it crashes ones it gets to that part. Same thing with using the delay method you used on some of your other videos. So far I've been using tutle.mainloop() at the end to keep the window going, but I can't figure out how to have the game check for collisions this way. How can I go about that? Thanks!

distinct
Автор

What if you want to make the object in the treasure random?

bennettzantium
Автор

I'm sorry i still have one more little question is why in the distance formula you have to square root to a**2 and b**2.
And in my game it have a problem in the collision is:
A=self.xcor()-other.xcor()
AttributeError: 'str' object has no attribute 'xcor'
I am very confused i hope you will answer my question .Thank you very much the best youtuber.

perfectday
Автор

i don't know why but suddenly my code doesn't work this is what it said :
PROBLEM WITH THONNY'S BACK-END:



Traceback (most recent call last):

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 1165, in wrapper

result = method(self, *args, **kwargs)

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 1152, in wrapper

return method(self, *args, **kwargs)

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 1224, in _execute_prepared_user_code

exec(statements, global_vars)

File "C:\Users\hp\Desktop\try3.py", line 141, in <module>

setup_maze(levels[1])

File "C:\Users\hp\Desktop\try3.py", line 128, in setup_maze

pen.stamp()

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\turtle.py", line 3054, in stamp

stitem = screen._createpoly()

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\turtle.py", line 497, in _createpoly

return self.cv.create_polygon((0, 0, 0, 0, 0, 0), fill="", outline="")

File "<string>", line 1, in create_polygon

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\tkinter\__init__.py", line 2498, in create_polygon

return self._create('polygon', args, kw)

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\tkinter\__init__.py", line 2480, in _create

*(args + self._options(cnf, kw))))

_tkinter.TclError: invalid command name ".!canvas"



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 1211, in execute_source

return self._execute_prepared_user_code(statements, expression, global_vars)

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 1170, in wrapper

return {"user_exception":

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 1002, in _prepare_user_exception

"stack": self._export_stack(last_frame),

File "C:\Users\hp\AppData\Local\Programs\Thonny\lib\site-packages\thonny\backend.py", line 894, in _export_stack

module_name =

KeyError: '__name__'

sherazadebjd
Автор

Does it work automatic or we have to run it ourselves?

edwardleo
Автор

my math.sqrt is not functioning. says math does not exist :(

sudarshandas
Автор

can u give me the link for this tutorial on your website? I couldn't find it

rodrigonedel
Автор

how do i give it like a random chance of spawning like 1/2 so if it was 2 it would spawn and otherwise not I'm making kinda like a dungeon raider rpg kinda thing and I want like 3 different chests Basic uncommon Rare and want each one to have a different chance of spawning in how to make them different sprites spawn on map bot idk how to make them have a Chance of spawning

pyettefamily
Автор

I want my treasure appear random on the screen not in only one position and i don"t want the treasure appear on the wall .So how can i do that

perfectday
Автор

i also have a problem but when it occurs, there is no error message in the console.
it says Method go_up might be static and i dont underdstand

EthanJbleethan
join shbcf.ru