Skip to content

module simulator

Tianshu Huang edited this page Dec 2, 2018 · 4 revisions

Simulator Module

Maintainers

Slack Github
Matthew @RoboticFish @dimembermatt
Mina @minagawargious @MinaGawargious
Chad @chadharthan @chardharthan

Related Issues

Links

PiSwarmSim

Pseudocode

Class Object:
    Attributes:
        - x
        - y
        - theta
        - shape
        - size
        - color
        - id
    Methods:
        - draw
        - collision(Object) -> bool

Class Cube(Object):
    Attributes:
        - letter

Class Robot(Object):
    Attributes:
        - name
    Methods:
        - move(rotate=0, forward=0)

Class Field:
    Attributes:
        - objects
    Methods:
        - check_collisions() -> bool
            for x in objects:
                for y in objects:
                    if x.id != y.id and x.collision(y):
                        show collision message
        - draw
        - loop:
            clear_screen()
            self.draw()
            for x in self.objects:
                x.draw()

Clone this wiki locally