Changeset 129


Ignore:
Timestamp:
01/23/12 23:27:51 (13 years ago)
Author:
atzm
Message:

modified damaged behavior

Location:
pycodeshooter/trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • pycodeshooter/trunk/index.html

    r128 r129  
    4242        registerSound("se_start", document.getElementById("se_start")); 
    4343        registerSound("se_encounter", document.getElementById("se_encounter")); 
    44         registerSound("se_damage_enemy", document.getElementById("se_damage_enemy")); 
    45         registerSound("se_damage_player", document.getElementById("se_damage_player")); 
     44        registerSound("se_damage", document.getElementById("se_damage")); 
    4645        registerSound("se_bomb", document.getElementById("se_bomb")); 
    4746        registerSound("se_destroy", document.getElementById("se_destroy")); 
     
    170169                <audio src="sounds/se_coinin_1.ogg", id="se_start" preload="auto" /> 
    171170                <audio src="sounds/se_denshion_1.ogg", id="se_encounter" preload="auto" /> 
    172                 <audio src="sounds/se_pyuun.ogg", id="se_damage_player" preload="auto" /> 
    173                 <audio src="sounds/se_click_2.ogg", id="se_damage_enemy" preload="auto" /> 
     171                <audio src="sounds/se_click_2.ogg", id="se_damage" preload="auto" /> 
    174172                <audio src="sounds/se_zusyunzusyun.ogg", id="se_bomb" preload="auto" /> 
    175173                <audio src="sounds/se_zugan.ogg", id="se_destroy" preload="auto" /> 
  • pycodeshooter/trunk/shooter/system.js

    r126 r129  
    188188 
    189189        if (enemy.isDead()) { 
    190             playSound("se_destroy"); 
    191  
    192             addDeathPieces( 
    193                 enemy.x, enemy.y, 
    194                 [6, 8, 10], ["#55F", "#AAF"], 3, 8 
    195             ); 
    196  
    197190            if (System.score[trooper.name] !== undefined) { 
    198191                System.score[trooper.name] += enemy.maxLife * 100; 
     
    353346        brrgs 
    354347    ); 
    355     enemy.registerCallback("damaged", function() {playSound("se_damage_enemy")}); 
     348 
     349    enemy.registerCallback("damaged", function() { 
     350        if (enemy.isDead()) { 
     351            playSound("se_destroy"); 
     352 
     353            addDeathPieces( 
     354                enemy.x, enemy.y, 
     355                [6, 8, 10], ["#F55", "#FAA"], 3, 8 
     356            ); 
     357        } 
     358        else { 
     359            playSound("se_damage"); 
     360        } 
     361    }); 
    356362 
    357363    System.enemies.push(enemy); 
     
    533539                          -0.5)] 
    534540    ); 
    535     trooper.registerCallback("addBomb", function(){playSound("se_bomb")}); 
    536     trooper.registerCallback("damaged", function(){playSound("se_damage_player")}); 
     541    trooper.registerCallback("addBomb", function() { playSound("se_bomb"); }); 
     542    trooper.registerCallback("damaged", function() { 
     543        playSound("se_destroy"); 
     544 
     545        addDeathPieces( 
     546            trooper.x, trooper.y, 
     547            [6, 8, 10], ["#55F", "#AAF"], 3, 8 
     548        ); 
     549 
     550        for (var i = 0; i < System.enemies.length; i++) { 
     551            System.enemies[i].clearBullet(); 
     552        } 
     553 
     554        trooper.x = System.screen.width / 2; 
     555        trooper.y = System.screen.height - System.screen.height / 7; 
     556    }); 
    537557 
    538558    System.players.push(trooper); 
Note: See TracChangeset for help on using the changeset viewer.