Debugging Python pygame being run through livewires
Python seems to completely ignore one of my objects 开发者_开发问答- the games.Text object. Can't seem to understand why, syntax seems correct. Here's the code.
from livewires import games
#Creating and validating the pygame screen.
myscreen = games.Screen ()
#Loading an image into memory to create an image object
wall_image = games.load_image("wall.jpg", transparent = False)
myscreen.set_background(wall_image)
#Printing Arbitary Score
games.Text(screen = myscreen, x = 500, y = 30,
text = "Score: 1756521",
size = 50, color = color.black)
myscreen.mainloop()
Your problem seems to be some combination of misspelling "colour" in a few places (this package is from the UK), forgetting
from livewires import colour
and failing to notice an error message:
NameError: name 'color' is not defined
At least I assume that's your problem, because after those changes it runs just fine for me, displaying the "score" text in the top right.
精彩评论