Tryout Task Tutorial

  1. I think you have to learn a bit more about Python. I have used Will McCugan’s “Beginning Game Development with Python and Pygame: From Novice to Professional” for example. Also check the Python docs: docs.python.org/

  2. If you want to show error messages on the forum, do not make a screenshot. Instead, copy the text from the console to the forums using [ code ] tags.

  3. You have edited the graphics, but Panda does not know about that. Panda does not magically read pictures. You have to use text some way, for example tags.
    About the spawnAsteroids function. You are using

for i in range(10)

which creates the numbers 0 to 9. Let’s say you want to have 50% of the elements to be letters, 50% to be numbers. You can use the modulo % operator for that.
The modulo operator checks if number1 divided by number2 produces a remainder, like: 2/2 = 0, no rest, 3/2 = 1, has a remainder.

For example:

for i in range(10):
...     print i % 2

will print: 0,1,0,1,0,1,0,1,0,1.

for i in range(10):
...     print i % 3

will print: 0,1,2,0,1,2,0,1,2,0. You could use that to create three classes of objects instead of two.

def spawnAsteroids(self):
    for i in range(10):
        asteroid = loadObject("asteroid" + str(randint(1,3)), scale = AST_INIT_SCALE)
        if i % 2 == 0:
            asteroid.setTag("isLetter", 1)
        else:
            asteroid.setTag("isLetter", 0)
        self.asteroids.append(asteroid)