Week 19 - ngetachew/Portfolio GitHub Wiki

On Tuesday, we continued to work on the indeffector's solenoid. I used a file I created called indeffectortest.py to isolate the solenoid and move it up and down while I adjusted the collet on its shaft so I could play with its range of motion. Unfortunately, while I was testing it, I left the solenoid on for a few minutes because I stopped the program before it turned off. The solenoid is only supposed to get 12 volts, but the way its wired makes it get 24. Due to this, we aren't supposed to leave it on for more than a few seconds. When I left it on, it got extremely hot, which somehow lead to the shaft becoming constricted. No matter how we adjusted it, the shaft refused to move more than a quarter of an inch, so we could no longer drop the game piece. We've resorted to filing and sanding the taper on the shaft in order to make it fit better.

I spent the majority of my time this week perfecting the huntPlayer() function in display.py. I realized that the bear doesn't actually eat the player, so I fixed this by creating a new function called eatActor. Each of the difficulties, easy, medium, and hard, are completely functional. In easy mode, the bear just moves around randomly. In medium mode, the bear goes to the fish and then guards it by hovering around it. In hard mode, the bear moves towards either the player or the fish, depending on which is closer. We decided to make the bear the sole difference between the game modes, meaning that the number of obstacles remains constant throughout the game. We ran into a problem however. The obstacles are currently generated almost randomly. Combined with the bear, there were multiple instances where the game was unwinnable because the goal was blocked off. We decided that the only way to fix this was to have preset map designs. That being said, we want everyone who plays this game to have a unique experience while playing it, so we decided that we would let other students in the academy design and submit map layouts. We will do this by having them design it on a grid on Google Sheets, then I will write a python file to analyze this grid and translate it into coordinates for the game.

`def eatActor(self,next):

    actor = main.findActor(next)

    if 'Player' in actor.source:

        actor.source = TransparentId

        self.move(next)

        c.send_packet(PacketType.responseCommand, b"lose")

        return

    else:

        self.move(next)`