~joshbrown/snakes-game/trunk

« back to all changes in this revision

Viewing changes to snakes

  • Committer: Josh Brown
  • Date: 2010-09-04 19:09:29 UTC
  • Revision ID: joshbrown15@gmail.com-20100904190929-iedlg158y623564g
Simplify code

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    
65
65
    def update(self, hpos):
66
66
        (screen_height, screen_width) = self.screen.getmaxyx()
67
 
        if hpos[0] == self.pos[0] and hpos[1] == self.pos[1]:
 
67
        if hpos == self.pos:
68
68
            self.pos = [random.randint(1,screen_height-1),random.randint(1,screen_width-1)]
69
69
        self._draw()
70
70