Changeset 286 for pycodeshooter
- Timestamp:
- 04/18/16 03:00:39 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/shooter/system.js
r132 r286 28 28 "score": {}, 29 29 "stage": -1, 30 "round": 1, 30 31 "backgroundObject": new Array(), 31 32 "deathPieces": new Array(), … … 282 283 } 283 284 285 function getRoundNumber() { 286 return System.round; 287 } 288 284 289 function switchStage(base) { 285 290 var scores = Object.keys(System.score); … … 302 307 stage = Math.floor((score % (stages.length * base)) / base) + 1; 303 308 switched = System.stage != stage; 309 System.round = System.stage > stage ? System.round + 1 : System.round; 304 310 System.stage = stage; 305 311 … … 357 363 var brrgs = new Array(); 358 364 359 var bulletWay = Math.ceil(enemyData.concentration / 10) ;365 var bulletWay = Math.ceil(enemyData.concentration / 10) * getRoundNumber(); 360 366 var bulletInterval = Math.round(50 * 1 / Math.log(enemyData.skillpoint + 0.1)); 361 367 var bulletSize = Math.round(Math.log(enemyData.luck + 1)); 362 368 var bulletFrameWidth = (bulletSize + 5) * 2; 363 369 var bulletFrameHeight = (bulletSize + 5) * 4; 364 var bulletSpeed = enemyData.strength / 15;370 var bulletSpeed = (enemyData.strength / 15) * getRoundNumber(); 365 371 366 372 bulletSpeed = Math.log(bulletSpeed < 1.5 ? 1.5 : bulletSpeed); … … 433 439 ); 434 440 435 var itemAttr; 436 var itemRand = Math.floor(Math.random() * 100); 437 if (itemRand < 40) { 438 // nothing 441 var itemAttr = null; 442 443 PLAYERSLOOP: 444 for (var i = 0; i < System.players.length; i++) { 445 for (var k = 0; k < System.players[i].barrages.length; k++) { 446 if (System.players[i].barrages[k].way <= 1) { 447 itemAttr = {"color": "#FAA", "symbol": "P", "type": "shot", "quantity": 1}; 448 break PLAYERSLOOP; 449 } 450 } 439 451 } 440 else if (itemRand < 70) { 441 itemAttr = {"color": "#AAF", "symbol": "S", "type": "score", "quantity": enemy.maxLife * 200}; 442 } 443 else if (itemRand < 85) { 444 itemAttr = {"color": "#FAA", "symbol": "P", "type": "shot", "quantity": 1}; 445 } 446 else if (itemRand < 95) { 447 itemAttr = {"color": "#A5F", "symbol": "W", "type": "wide", "quantity": 1}; 448 } 449 else if (itemRand < 98) { 450 itemAttr = {"color": "#FFA", "symbol": "B", "type": "bomb", "quantity": 1}; 451 } 452 else { 453 itemAttr = {"color": "#AFA", "symbol": "L", "type": "life", "quantity": 1}; 452 453 if (!itemAttr) { 454 var itemRand = Math.floor(Math.random() * 100); 455 if (itemRand < 40) { 456 // nothing 457 } 458 else if (itemRand < 70) { 459 itemAttr = {"color": "#AAF", "symbol": "S", "type": "score", "quantity": enemy.maxLife * 200}; 460 } 461 else if (itemRand < 85) { 462 itemAttr = {"color": "#FAA", "symbol": "P", "type": "shot", "quantity": 1}; 463 } 464 else if (itemRand < 95) { 465 itemAttr = {"color": "#A5F", "symbol": "W", "type": "wide", "quantity": 1}; 466 } 467 else if (itemRand < 98) { 468 itemAttr = {"color": "#FFA", "symbol": "B", "type": "bomb", "quantity": 1}; 469 } 470 else { 471 itemAttr = {"color": "#AFA", "symbol": "L", "type": "life", "quantity": 1}; 472 } 454 473 } 455 474 … … 495 514 System.screen.ctx, 496 515 "source-over", 497 " STAGE " + getStageNumber(),516 "ROUND " + getRoundNumber() + " / STAGE " + getStageNumber(), 498 517 System.screen.width - 10, 499 518 15,
Note: See TracChangeset
for help on using the changeset viewer.