0

这是那段代码。

    'def remove_DeadObjects(self):'
            'for bullet in self.bullets:'
                'if not bullet.alive:'
                    'self.bullets.remove(bullet)'
                
            'for asteroid in self.asteroids:'
                'if not asteroid.alive:'
                    'self.asteroids.remove(asteroid)'
            'if not self.ship.alive:'
                'arcade.draw_text("Sorry, you got hit. Maybe try some spaceship training! See you soon!!", width = 300, height = 300,arcade.color.BLUE,)'
4

1 回答 1

2

您将错误的参数传递给draw_text方法。下面是如何draw_text正确使用的小例子:

import arcade

arcade.open_window(600, 400, 'Text example')
arcade.start_render()
arcade.draw_text(text='Sorry, you got hit. Maybe try some spaceship training!', start_x=20, start_y=200, color=arcade.color.RED, font_size=20)
arcade.finish_render()
arcade.run()

输出:

在此处输入图像描述

于 2021-03-16T04:55:32.280 回答