ssoria / flatland-arg

Rewrite of the Flatland ARG using Python and Twisted
http://games.ucla.edu/games/flatland/
1 stars 7 forks source link

Integrate gesture recognition into controller.py #2

Closed taboularasa closed 13 years ago

taboularasa commented 13 years ago

need to get the gesture recognition working with the rest of the system

taboularasa commented 13 years ago

I started integrating the gesture recognition into controller.py but I have some questions about how you would prefer the gesture input works with the keyboard input. So far I've connected gesture recognition to the _handleInput() function. right now I'm storing the results to a self._currentPattern variable. Would it be reasonable to add this variable to if/else statements in _startedAction and _finishedAction functions? eg:

    def _startedAction(self, action):
        self._currentAction = action
        if self._currentAction == ATTACK or self._currentPattern == 'attack':
            self.perspective.callRemote('startAttacking')
        elif self._currentAction == BUILD or self._currentPattern == 'build':
            self.perspective.callRemote('startBuilding')
        elif self._currentAction == SCAN or self._currentPattern == 'scan':
            self.perspective.callRemote('startScanning')
            self.view.addAction("sweep")
        elif self._currentAction == UPGRADE:
            self.perspective.callRemote('startUpgrading')
        else:
            self._currentAction = None

Here are the changes so far: https://github.com/uclagamelab/flatland-arg/compare/master

ssoria commented 13 years ago

Yes, I think that's the proper way.

ssoria commented 13 years ago

Stupid Commend & Close button...

taboularasa commented 13 years ago

one last question, what is the UPGRADE action? isn't upgrading done by preforming the build action under special circumstances?

ssoria commented 13 years ago

I believe we decided at one point that players would be building at the poly factory and the player who wanted to upgrade would perform the upgrade action. This way we knew who to upgrade.

taboularasa commented 13 years ago

oh, well I can track four different gestures right now, but two of them are similar: rotating the scepter clockwise or counterclockwise. I was planning on using both of those for attack, maybe we could use one for attack and one for upgrade. alternatively it might be possible to recognize other gestures as well but I didn't test anything other than the three that we started out with. I guess I'll bring this up in the meeting next week

taboularasa commented 13 years ago

this is done