Code using PySimbot - jetstreamc/PySimbot GitHub Wiki

PySimbot is designed to create a robot simulation with less code. To modify the simulation, you can override the Robot logic or passing the parameters to the Simulation. Since the coding logic of the simulation is wrapped in the library, you mostly do nothing on handling the UI and physics of the simulation. You can keep focusing on the robot logic.

To run the simulation, the basic code is provided below

from pysimbotlib.core import PySimbotApp

if __name__ == '__main__':
    app = PySimbotApp()
    app.run()

You can create you own robot by extending the Robot class and passing your class as the argument to PySimbotApp constructor.

from pysimbotlib.core import PySimbotApp, Robot

class MyRobot(Robot):
    def update(self):
        pass

if __name__ == '__main__':
    app = PySimbotApp(robot_cls=MyRobot)
    app.run()

By extending the Robot class, your class will automatically have the predefined sensors and actions of the robot. For more information, look at Robot page.

Overriding the update() method to customize the robot logic. You can put the Python code in this function e.g. read the robot's sensor values, and make the robot moves and turns.