Changeset 203:653da96db572


Ignore:
Timestamp:
Sep 4, 2009, 8:25:32 PM (11 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@204
Message:

Fixed dangling cursor sprite and did some TODO list maintenance.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TODO

    r178 r203  
    11== TODO ==
     2
     3* Fix cursor sprite layering
     4
     5* Add invalid cursor sprite
    26
    37* <Hodgestar> A BuildingFullError can be raised when attempting to hatch eggs in buildings.
     
    812
    913* Add the demolition fox
    10 
    11 * Finish egg selling
    1214
    1315* <jerith> Our menu isn't friendly and buildings don't show their contents.
     
    4749* <tzhau> simchicken! so are there gonna to be chicken processing plants? escaping chickens?
    4850  * <Hodgestar> tzhau: We could add some sort of self-managing henhouse that sells chickens automatically to make space for hatching eggs.
    49 
    50 * <Nitwit> Hodgestar: I see the ninja fox screenshot shows we have a chicken counting bug somewhere
    51   * <Hodgestar> Nitwit: Is the chicken perhaps inside? Or is the number too low?
    52   * <Nitwit> Hodgestar: the number's too low - there are 5 chickens visible, but a count of only 4
  • gamelib/engine.py

    r202 r203  
    121121            return NightState(self.game)
    122122        elif e.type is KEYDOWN and e.key == K_ESCAPE:
    123             self.game.gameboard.reset_cursor()
     123            self.game.gameboard.set_cursor()
    124124            return GameOver(self.game)
    125125        elif e.type is ANIM_ID:
     
    149149        sound.stop_background_music()
    150150        self.game.gameboard.tv.sun(False)
    151         self.game.gameboard.reset_cursor()
     151        self.game.gameboard.set_cursor()
    152152
    153153        sound.play_sound("nightfall.ogg")
     
    169169            return pygame.event.post(START_DAY)
    170170        elif e.type is KEYDOWN and e.key == K_ESCAPE:
    171             self.game.gameboard.reset_cursor()
     171            self.game.gameboard.set_cursor()
    172172            return GameOver(self.game)
    173173        elif e.type is ANIM_ID:
  • gamelib/gameboard.py

    r202 r203  
    250250        self.selected_tool = tool
    251251        self.select_animal_to_place(None)
     252        sprite_curs = None
     253        if buildings.is_building(tool):
     254            sprite_curs = sprite_cursor.SpriteCursor(tool.IMAGE, self.tv)
     255        self.set_cursor(cursor, sprite_curs)
     256
     257    def set_cursor(self, cursor=None, sprite_curs=None):
    252258        if cursor:
    253259            pygame.mouse.set_cursor(*cursor)
     
    257263            self.tv.sprites.remove(self.sprite_cursor)
    258264            self.sprite_cursor = None
    259         if buildings.is_building(tool):
    260             self.sprite_cursor = sprite_cursor.SpriteCursor(tool.IMAGE, self.tv)
     265        if sprite_curs:
     266            self.sprite_cursor = sprite_curs
    261267            self.tv.sprites.append(self.sprite_cursor)
    262 
    263     def reset_cursor(self):
    264         pygame.mouse.set_cursor(*cursors.cursors['arrow'])
     268           
    265269
    266270    def update_sprite_cursor(self, e):
     
    280284        if e.button == 3: # Right button
    281285            self.selected_tool = None
    282             self.reset_cursor()
     286            self.set_cursor()
    283287        elif e.button != 1: # Left button
    284288            return
Note: See TracChangeset for help on using the changeset viewer.