I have been programming from the book Python for Absolute Beginners, using Python 3.3.1.
I am trying to add text to a screen using the following code. I need to stay in Python 3.3.1 but the code from the book I think is for Python 2.X.
from livewires import games, color
class Pizza(games.Sprite):
"""A falling pizza"""
def __init__(self, screen, x,y, image, dx, dy):
"""Initialise pizza object"""
self.init_sprite(screen = screen, x = x, y = y, image = image, dx = dx, dy = dy)
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
#main
my_screen = games.Screen(SCREEN_WIDTH, SCREEN_HEIGHT)
wall_image = games.load_image("wall.jpg", transparent = False)
pizza_image = games.load_image("pizza.jpg")
my_screen.set_background(wall_image)
games.Text(screen = my_screen, x = 500, y = 30, text = "Score: 1756521", size = 50, color =
my_screen.mainloop()
However, when I run this program I get an error (see below)
games.Text(screen = my_screen, x = 500, y = 30, text = "Score: 1756521", size = 50, color = color.black)
TypeError: __init__() got an unexpected keyword argument 'text'
I hope you can help