Ignore:
Timestamp:
01/12/11 18:39:31 (13 years ago)
Author:
atzm
Message:

bomb support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pycodeshooter/trunk/shooter/action.js

    r81 r92  
    2121const ACTION_DELAY  = 32; 
    2222const SWITCH_BULLET = 1; 
     23const SWITCH_BOMB   = 2; 
    2324var   currentAction = 0; 
    2425var   currentSwitch = 0; 
     
    5758function getSwitchByCharCode(charCode) { 
    5859    switch(charCode) { 
     60    case 97:  // a 
     61        return SWITCH_BOMB; 
    5962    case 99:  // c 
    6063        return SWITCH_BULLET; 
     
    106109                this.index = 0; 
    107110            unsetSwitch(SWITCH_BULLET); 
     111        } 
     112        if (isSetSwitch(SWITCH_BOMB)) { 
     113            trooper.addBomb(); 
     114            unsetSwitch(SWITCH_BOMB); 
    108115        } 
    109116        if (isInAction(ACTION_SHOT)) 
Note: See TracChangeset for help on using the changeset viewer.