Changeset 340:f870e3122ac7


Ignore:
Timestamp:
04/09/11 10:55:38 (12 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Rebase:
38313637303935303663633036373562383365323630646134623937613939636536343335366532
Message:

Collect haiku scrolls.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • data/game.json

    r337 r340  
    1818        "doorway": "starting",
    1919        "tofu": 0,
    20         "scrolls": 0
     20        "scrolls": []
    2121    },
    2222    "missions": {
     
    4040        "vase": { "type": "Vase", "level": "geisha_room", "pos": [1, 3], "broken": false },
    4141        "salmon": { "type": "Salmon", "level": "fishmonger_house", "pos": [1, 3] },
     42        "haiku1": { "type": "HaikuScroll", "level": "temple", "pos": [14, 16], "text": "a cherry blossom" },
    4243        "aburage_001": { "type": "Aburage", "level": "temple", "pos": [12, 2] },
    4344        "aburage_002": { "type": "Aburage", "level": "temple", "pos": [14, 2] }
  • skaapsteker/levelscene.py

    r339 r340  
    215215
    216216        pos = self._clip_rect.right - 20, self._clip_rect.top + 225
    217         count = Text("%s" % fox.scrolls, pos)
     217        count = Text("%s" % len(fox.scrolls), pos)
    218218        count.draw(self._level_surface)
    219219        pos = self._clip_rect.right - 55, self._clip_rect.top + 220
  • skaapsteker/sprites/items.py

    r335 r340  
    1111        player.eat_aburage()
    1212        self.remove()
     13
     14
     15class HaikuScroll(Item):
     16    image_file = 'haiku-scroll.png'
     17
     18    def player_action(self, player):
     19        player.collect_scroll(self)
     20        self.remove()
     21
     22
     23    def setup(self, text, **opts):
     24        super(HaikuScroll, self).setup(**opts)
     25        self.text = text
    1326
    1427
  • skaapsteker/sprites/player.py

    r339 r340  
    376376        self._touching_actionables.append(actionable)
    377377
     378
    378379    def eat_aburage(self):
    379380        self._me.tofu += 1
     381
     382
     383    def collect_scroll(self, scroll):
     384        self._me.scrolls.append(scroll.text)
     385
Note: See TracChangeset for help on using the changeset viewer.