Changeset 336:c8fd82ff0c71


Ignore:
Timestamp:
04/09/11 10:29:34 (12 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Phase:
public
Message:

Hook up fire buttons to attack functions. Use correct check for tails. Add skeleton for projectiles.

Location:
skaapsteker/sprites
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/base.py

    r335 r336  
    219219
    220220
    221 class Projectile(GameSprite):
     221class Projectile(AnimatedGameSprite):
    222222    gravitates = False
    223223
  • skaapsteker/sprites/enemies.py

    r333 r336  
    2828                self.facing = 'left'
    2929        Monster.start_attack(self, player)
     30
     31
     32class FireballOni(RedOni):
     33    pass # TODO
  • skaapsteker/sprites/player.py

    r335 r336  
    235235            self.drop_item()
    236236
     237    def _bite_attack(self):
     238        print 'ninja bite attack'
     239        self.attacking = 2
     240        self._last_time = time.time() # Reset the animation clock
     241
     242    def _fireball_attack(self):
     243        print 'ninja fireball attack attack attack'
     244        self.attacking = 2
     245        self._last_time = time.time() # Reset the animation clock
     246
     247    def _lightning_attack(self):
     248        print 'thunderbolts and lightning'
     249        self.attacking = 2
     250        self._last_time = time.time() # Reset the animation clock
    237251
    238252    def action_fire1(self):
    239         # FIXME: Use the correct tail properties for this
    240         if len(self._me.tails) < 2:
    241             # Only have a bite attack
    242             print 'attacking'
    243             self.attacking = 2
    244             # Reset the animation clock
    245             self._last_time = time.time()
    246         print "F1"
     253        if "fireball" not in self._me.tails:
     254            self._bite_attack()
     255        else:
     256            self._fireball_attack()
    247257
    248258    def action_fire2(self):
    249         print "F2"
     259        if "lightning" not in self._me.tails:
     260            self._bite_attack()
     261        else:
     262            self._lightning_attack()
    250263
    251264    def _get_action(self):
     
    362375        self._touching_actionables.append(actionable)
    363376
    364 
    365377    def eat_aburage(self):
    366378        self._me.tofu += 1
    367 
Note: See TracChangeset for help on using the changeset viewer.