Changeset 112


Ignore:
Timestamp:
01/18/12 19:22:25 (12 years ago)
Author:
atzm
Message:

scoring support

Location:
pycodeshooter/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pycodeshooter/trunk/index.html

    r111 r112  
    208208          <li>動䜜パタヌンを増やす</li> 
    209209          <li>匟幕パタヌンを増やす</li> 
    210           <li>ボム衚瀺</li> 
    211           <li>スコアリング</li> 
    212210          <li>パワヌアップアむテム</li> 
    213           <li>敵/自機に画像ずか</li> 
    214           <li>メニュヌを䜕ずかする</li> 
    215           <li>ダメヌゞ時動䜜を凝る</li> 
     211          <li>動䜜を凝る</li> 
     212          <li>音を鳎らす</li> 
    216213        </ul> 
    217214 
  • pycodeshooter/trunk/shooter/system.js

    r111 r112  
    2525    "enemies":          new Array(), 
    2626    "players":          new Array(), 
     27    "score":            {}, 
    2728    "backgroundObject": new Array(), 
    2829    "deathPieces":      new Array(), 
     
    185186                [6, 8, 10], ["#55F", "#AAF"], 3, 8 
    186187            ); 
     188 
     189            if (System.score[trooper.name] !== undefined) { 
     190                System.score[trooper.name] += enemy.maxLife * 100; 
     191            } 
    187192        } 
    188193        else { 
     
    291296        1, "#CAF", 10 
    292297    ); 
     298 
     299    // draw score 
     300    var scoreNames = Object.keys(System.score).sort(); 
     301    for (var i = 0; i < scoreNames.length; i++) { 
     302        var name = scoreNames[i]; 
     303        drawString( 
     304            System.screen.ctx, 
     305            "source-over", 
     306            name + " score " + System.score[name], 
     307            (System.screen.width - 10), 
     308            i * 16 + 15, 
     309            "#ACF", "9pt monospace", "right" 
     310        ); 
     311    } 
    293312 
    294313    // update/draw troopers 
     
    422441    )); 
    423442 
     443    for (var i = 0; i < System.players.length; i++) { 
     444        System.score[System.players[i].name] = 0; 
     445    } 
     446 
    424447    System.backgroundObject = new Array(); 
    425448    System.mainIntervalId   = setInterval(mainLoop, 20); 
  • pycodeshooter/trunk/shooter/trooper.js

    r109 r112  
    8888    this.h          = h; 
    8989    this.life       = life; 
     90    this.maxLife    = life; 
    9091    this.speed      = speed; 
    9192    this.numBombs   = numBombs; 
Note: See TracChangeset for help on using the changeset viewer.