Revisão 18
Future Places RC
| Blackmatter.pde | ||
|---|---|---|
| 13 | 13 |
int y = 0; |
| 14 | 14 |
int diameter = 50; |
| 15 | 15 |
boolean dead = false; |
| 16 |
float vx = 0; |
|
| 17 |
float vy = 0; |
|
| 16 | 18 |
|
| 17 | 19 |
void setup () |
| 18 | 20 |
{
|
| ... | ... | |
| 29 | 31 |
|
| 30 | 32 |
ellipse (this.x, this.y, this.diameter, this.diameter); |
| 31 | 33 |
|
| 34 |
|
|
| 35 |
if ( ( this.x + vx <= 0 ) || ( this.x + vx >= _game_.width) ) {
|
|
| 36 |
this.vx = -vx; |
|
| 37 |
} |
|
| 38 |
if ( ( this.y + vy <= 0 ) || ( this.y + vy >= _game_.height) ) {
|
|
| 39 |
this.vy = -vy; |
|
| 40 |
} |
|
| 41 |
|
|
| 42 |
this.x += vx; |
|
| 43 |
this.y += vy; |
|
| 44 |
|
|
| 45 |
|
|
| 32 | 46 |
if (this.diameter > 0) |
| 33 | 47 |
this.diameter--; |
| 34 | 48 |
|
| ... | ... | |
| 67 | 81 |
return false; |
| 68 | 82 |
*/ |
| 69 | 83 |
} |
| 70 |
} |
|
| 84 |
} |
|
Também disponível em: Unified diff