1

I'm running into some problems where it returns:

TypeError: run() missing 1 required positional argument: 'self'

Here is the Code:

from direct.showbase.ShowBase import ShowBase

class MyGame(ShowBase):
def __init__(self):
    super.__init__()


Game = MyGame
Game.run()

Why is this happening?

a121
  • 798
  • 4
  • 9
  • 20
Alomoria
  • 39
  • 4
  • Does this answer your question? [TypeError: Missing 1 required positional argument: 'self'](https://stackoverflow.com/questions/17534345/typeerror-missing-1-required-positional-argument-self) – Zach Gates Aug 28 '20 at 07:36

2 Answers2

0

When you instantiate an object from a class in python, you have to use brackets. Like when you call a function.

Game = MyGame() # add brackets after MyGame
Attila Toth
  • 469
  • 3
  • 11
-1

First write:

from direct.showbase.Showbase import Showbase
anyvariable = Showbase()
class MyGame(anyvariable):

And then add the rest of your code here onwards.

gazsi
  • 1