0

I imported the Ursina module to python. Ursina is game engine. You can find it here : Ursina Game Engine

I was trying to learn how to use this module from the tutorials given on the website itself. I am unable to understand this part of the code. Can anyone please explain this:

from ursina import *

class Inventory(Entity):
    def __init__(self):
        super().__init__(
            parent = camera.ui,
            model = 'quad',
             scale = (.5, .8),                                           
             origin = (-.5, .5),                                         
             position = (-.3,.4),                                        
             texture = 'white_cube',                                     
             texture_scale = (5,8),                                      
             color = color.dark_gray                                     
            )



if __name__ == '__main__':
    app = Ursina()
    inventory = Inventory()
    app.run()

These are my specific questions:


  1. What is super()?

  2. Why are the functionalities of super() class?

  3. What is the purpose of the condition if __name__ == '__main__':


@pokepeter P.S. Tutorials of Ursina Game Engine has a lot of typos, please provide a way to notify the same.

Muhammad Usman Bashir
  • 1,441
  • 2
  • 14
  • 43
Adarsh TS
  • 193
  • 15
  • 3
    Does this answer your question? [What does 'super' do in Python?](https://stackoverflow.com/questions/222877/what-does-super-do-in-python) – gbeaven Jan 30 '20 at 16:44
  • All three questions have been answered on Stack Overflow several times. – Klaus D. Jan 30 '20 at 16:47

0 Answers0