Projeto

Geral

Perfil

Estatísticas
| Revisão:

root / processing / blacklight / Winner.pde @ 18

Histórico | Ver | Anotar | Download (1,17 KB)

1
/*
2
BLACKLIGHT v1.0
3
Project made for Mestrado de Comunicação Multimédia, Ramo Multimédia Interactivo at Departamento de Comunicação e Arte at Universidade de Aveiro.
4

    
5
Author: Nuno Simaria - nsimaria@ua.pt - #23652
6
Other workgroup members: Ana Filipa Lacerda, Daniela Rei, Renato Costa, Julien Cuenin
7
*/
8

    
9
class Winner
10
  {
11
  int team = -1;
12
  int countdown = 1000;
13
  void setup (int team)
14
    {
15
    this.team = team;
16
    }
17
    
18
  void draw ()
19
    {
20
    String message = "";
21
    switch (this.team)
22
      {
23
      case 0: fill (255); background (0); message = "Black wins. All hail the blacklord."; break;
24
      case 1: fill (0); background (255); message = "White wins. The light shines in our path."; break;
25
      }
26

    
27
    
28
    this.countdown--;
29
    
30

    
31
    textFont (_bold_, 40);
32
    text (message, 50, _game_.height / 2 + 50);
33
    text ("next battle in " + this.countdown + " time units.", 50, _game_.height / 2 + 100);
34

    
35
    scale (-1, 1);
36
    text (message, -_game_.width + 50, _game_.height / 2 - 100);
37
    text ("next battle in " + this.countdown + " time units.", -_game_.width + 50, _game_.height / 2 -50);
38
    scale (-1, 1);
39

    
40
    if (this.countdown == 0)
41
      _game_.reset ();
42
    
43
    }
44
  }