Revisão 18
Future Places RC
| Level.pde | ||
|---|---|---|
| 13 | 13 |
Blacklord blacklord = null; |
| 14 | 14 |
Lightlord lightlord = null; |
| 15 | 15 |
Scoreboard scoreboard = null; |
| 16 |
int timer = 0; |
|
| 16 | 17 |
|
| 17 | 18 |
Serial port = null; |
| 18 | 19 |
|
| ... | ... | |
| 34 | 35 |
return; |
| 35 | 36 |
} |
| 36 | 37 |
|
| 37 |
|
|
| 38 |
this.timer = 1000; |
|
| 39 |
|
|
| 38 | 40 |
this.battlefield = new Battlefield (1024, 768); |
| 39 | 41 |
this.lightlord = new Lightlord (); |
| 40 | 42 |
this.blacklord = new Blacklord (); |
| ... | ... | |
| 88 | 90 |
|
| 89 | 91 |
for (int j = 0; j < this.blacklord.blackmatter.size (); j++) |
| 90 | 92 |
{
|
| 91 |
Blackmatter b = (Blackmatter) this.blacklord.blackmatter.get (j); |
|
| 92 |
Cell cell = this.battlefield.getCell (b.x, b.y); |
|
| 93 |
cell.update(1); |
|
| 93 |
Blackmatter b = (Blackmatter) this.blacklord.blackmatter.get (j);
|
|
| 94 |
Cell cell = this.battlefield.getCell (b.x, b.y);
|
|
| 95 |
cell.update(1);
|
|
| 94 | 96 |
} |
| 95 | 97 |
|
| 96 | 98 |
this.scoreboard.draw (); |
| ... | ... | |
| 99 | 101 |
|
| 100 | 102 |
// DESCOMENTAR!! LEDS |
| 101 | 103 |
//this.output (balance); |
| 104 |
if ( this.timer <= 0 ) this.outcome (); |
|
| 105 |
this.timer--; |
|
| 102 | 106 |
|
| 103 |
//this.outcome (balance); |
|
| 104 | 107 |
|
| 105 |
|
|
| 106 | 108 |
// this.blacklord.attack (); |
| 107 | 109 |
|
| 108 | 110 |
// this.lightlord.defend (); |
| ... | ... | |
| 132 | 134 |
// println (value); |
| 133 | 135 |
} |
| 134 | 136 |
|
| 135 |
void outcome (int balance)
|
|
| 137 |
void outcome () |
|
| 136 | 138 |
{
|
| 137 |
this.rate--; |
|
| 139 |
int score = this.battlefield.blacks - this.battlefield.whites; |
|
| 140 |
|
|
| 141 |
if ( score > 0 ) {
|
|
| 142 |
_game_.blackWins (); |
|
| 143 |
} else if ( score < 0 ) {
|
|
| 144 |
_game_.lightWins (); |
|
| 145 |
} else {
|
|
| 146 |
this.timer += 1000; |
|
| 147 |
} |
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
/* this.rate--; |
|
| 138 | 152 |
|
| 139 | 153 |
if (this.rate == 0) |
| 140 | 154 |
{
|
| ... | ... | |
| 192 | 206 |
if (blackpower == 6) |
| 193 | 207 |
_game_.blackWins (); |
| 194 | 208 |
else if (lightpower == 6) |
| 195 |
_game_.lightWins (); |
|
| 209 |
_game_.lightWins ();*/
|
|
| 196 | 210 |
} |
| 197 | 211 |
} |
| 198 |
|
|
| 212 |
|
|
Também disponível em: Unified diff