Changeset 97 for pycodeshooter/trunk


Ignore:
Timestamp:
01/22/11 21:00:02 (13 years ago)
Author:
atzm
Message:

modified atari hantei

Location:
pycodeshooter/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pycodeshooter/trunk/index.html

    r95 r97  
    2020            "name":         document.getElementById("name").value, 
    2121            "size":         parseInt(document.getElementById("size").value), 
     22            "hitsize":      parseInt(document.getElementById("hitsize").value), 
    2223            "speed":        parseInt(document.getElementById("speed").value), 
    2324            "hitpoint":     parseInt(document.getElementById("hitpoint").value), 
     
    114115                <br /> 
    115116                <canvas id="screen" width="320" height="480"></canvas> 
    116                 <input type="hidden" value="5"  id="size" /> 
     117                <input type="hidden" value="7"  id="size" /> 
     118                <input type="hidden" value="1"  id="hitsize" /> 
    117119                <input type="hidden" value="5"  id="speed" /> 
    118120                <input type="hidden" value="7"  id="shotsize" /> 
  • pycodeshooter/trunk/shooter/system.js

    r96 r97  
    287287        new ActionList([new ManualAction(new ManualShot())]), 
    288288        playerData.size, 
     289        playerData.hitsize, 
    289290        "#33F", 
     291        "#F33", 
    290292        System.screen.width / 2, 
    291293        System.screen.height - System.screen.height / 7, 
     
    369371        new actList(acts), 
    370372        Math.ceil(50 * (1 / bossData.defense)), 
     373        Math.ceil(50 * (1 / bossData.defense)), 
     374        "#F33", 
    371375        "#F33", 
    372376        System.screen.width / 2, 
  • pycodeshooter/trunk/shooter/trooper.js

    r96 r97  
    6767}; 
    6868 
    69 var Trooper = function(name, actList, size, color, x, y, w, h, 
    70                        life, speed, numBombs, barrages) { 
     69var Trooper = function(name, actList, size, hitSize, color, hitColor, 
     70                       x, y, w, h, life, speed, numBombs, barrages) { 
    7171 
    7272    this.bullets  = new Array(); 
     
    7575    this.actList  = actList; 
    7676    this.size     = size; 
     77    this.hitSize  = hitSize; 
    7778    this.color    = color; 
     79    this.hitColor = hitColor; 
    7880    this.x        = x; 
    7981    this.y        = y; 
     
    141143        delIdx = new Array(); 
    142144        for (var i = 0; i < enemy.bullets.length; i++) { 
    143             if (touch(this.x, this.y, this.size, 
     145            if (touch(this.x, this.y, this.hitSize, 
    144146                      enemy.bullets[i].x, enemy.bullets[i].y, enemy.bullets[i].size)) 
    145147                delIdx.push(i); 
     
    164166        ctx.closePath(); 
    165167 
     168        if (this.color != this.hitColor || this.size != this.hitSize) { 
     169            ctx.beginPath(); 
     170            ctx.fillStyle = this.hitColor; 
     171            ctx.arc(this.x, this.y, this.hitSize, 0, Math.PI * 2.0, true); 
     172            ctx.fill(); 
     173            ctx.closePath(); 
     174        } 
     175 
    166176        // draw bullets 
    167177        for (var i = 0; i < this.bullets.length; i++) 
Note: See TracChangeset for help on using the changeset viewer.