#๐ pygame.error: video system not initialized
61 messages ยท Page 1 of 1 (latest)
@frank mason
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
I've been trying to make this game for my assignment but no matter how many times I re write the code or try a different method, I will always come back to this same problem
One this I also noticed is that the import sys is greyed out which I can't figure out how to fix
Full Error:
Traceback (most recent call last):
File "Trajectory", line 92, in <module>
for event in pygame.event.get():
^^^^^^^^^^^^^^^^^^
pygame.error: video system not initialized
show the code
Did it not send?
nope
tf
I can only see the error u wrote
that work?
Could i just dm it to you, or is there another way I have to provide it on the server.
yeah
Do i not need it?
I was led to beleive it was required for the drag and drog functions to work. That and to fix this error
no, if it was needed it wouldnt be greyed out (grey colour are for module u import but never use in your code)
what is the display size of the device u are using?
so u cant see the images u are using?
the title screen background and the start button
I can click where the start button would be and the phase changes as it would
are all the images actually present in the path u provided?
yes, they are
If i reverted my code, they would work
But it seems when I get to the drag and drop part of writing my code, it does this
IndentationError: expected an indented block after 'for' statement on line 118
oh yeah indent the if after the for loop using space or tab
so like this?
Traceback (most recent call last):
File "Trajectory", line 139, in <module>
team_health_text = font.render(f"Health: {pet.health}", True, (255, 255, 255))
^^^^
NameError: name 'font' is not defined. Did you mean: 'float'?
did u initialized the font u were going to use?
ah well since u are using font.render to display text u need to initialize it before
Initialize the font
font = pygame.font.Font(None, 36)
this is just an example
u can set it according the game u want to create
and add it before the while loop
Sorry i was gone for a bit
aight i've used ur example
but now the reroll button is broken.
I think it's this
Name 'mouse_pos' can be undefined
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.