tetra-turing-hunt-engine

Gadgets

Gadgets are shown to the left of the screen and update every step of the game. Therefore only fast updating code must be added to a Gadget. They help in adding elements to the game which need to be updated constantly without player interaction.

All gadgets inherit from the Gadget class.

The Gadget class provides the following functions-

The simplest gadget would need to at least do the following-

Though most gadgets are more complex than this, most of them can be implemented by simply overloading update and __str__. If the output has to also be changed to some other form of PySimpleGUI widget, then render_content needs to be overloaded. update will also need to be overloaded to update the PySimpleGUI widget appropriately.

Obviously, inherited classes can have other properties added to them initialized in __init__ as usual.

Adding Gadgets to a Game

Simply send a list of class names(not objects) to the gadget_classes parameter of the Game() function.

Demo Gadgets

As a demonstration, we have some inbuilt gadgets that you may want to use