我开始用 Ursina (Python) 编写一个游戏(魔方),代码如下:
from ursina import *
class Game(Ursina):
def __init__(self):
super().__init__()
window.fullscreen = True
Entity(model='quad', scale=60, texture='white_cube', texture_scale=(60, 60), rotation_x=90, y=5, color=color.light_gray)
Entity(model='sphere', scale=100, texture='textures/sky0', double_sided=True)
Entity(model='models/xyz', texture='textures/xyz', scale=0.8)
EditorCamera()
camera.world_position = (0, 0, -15)
self.load_game()
def load_game(self):
pass
def input(self, key):
super().input(key)
if __name__ == 'main':
game = Game()
game.run()
这是一个奇怪的错误:
Traceback (most recent call last):
File "C:\Users\MAKSIM\PycharmProjects\rubicocubico\main.py", line 2, in <module>
class Game(Ursina):
TypeError: function() argument 'code' must be code, not str