root / first_draft / first_draft.pde @ 4
Histórico | Ver | Anotar | Download (834 Bytes)
| 1 |
import processing.opengl.*; |
|---|---|
| 2 |
import JMyron.*; |
| 3 |
|
| 4 |
Blight blight; |
| 5 |
XMLElement config, levels; |
| 6 |
|
| 7 |
int _width_ = 0; |
| 8 |
int _height_ = 0; |
| 9 |
|
| 10 |
PFont _font_; |
| 11 |
int _font_size_; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
void config () |
| 24 |
{
|
| 25 |
_width_ = int (config.getChild ("screen/width").getContent ());
|
| 26 |
_height_ = int (config.getChild ("screen/height").getContent ());
|
| 27 |
|
| 28 |
_font_ = loadFont (config.getChild ("font/name").getContent ());
|
| 29 |
_font_size_ = int (config.getChild ("font/size").getContent ());
|
| 30 |
|
| 31 |
textFont (_font_, _font_size_); |
| 32 |
|
| 33 |
|
| 34 |
size (_width_, _height_, P3D); |
| 35 |
} |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
void mousePressed () |
| 47 |
{
|
| 48 |
blight.level (0); |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
void setup () |
| 58 |
{
|
| 59 |
config = new XMLElement(this, "xml/config.xml"); |
| 60 |
levels = new XMLElement(this, "xml/levels.xml"); |
| 61 |
|
| 62 |
config (); |
| 63 |
|
| 64 |
blight = new Blight (levels); |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
void draw () |
| 71 |
{
|
| 72 |
blight.draw (); |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|