3 BitmapResource peasantGfx { ":peasant.png" };
4 BitmapResource dragonGfx { ":dragon.png" };
5 BitmapResource mageGfx { ":mage.png" };
6 BitmapResource archerGfx { ":archer.png" };
7 BitmapResource castleGfx { ":castle.png" };
9 Array<BitmapResource> gfxResources { [ peasantGfx, dragonGfx, mageGfx, archerGfx, castleGfx ] };
15 void Render(Surface surface)
17 Bitmap bmp = res ? res.bitmap : null;
19 surface.Blit(bmp, x, y, 0,0, bmp.width, bmp.height);
26 class Peasant : WorldObject { res = peasantGfx; }
27 class Dragon : WorldObject { res = dragonGfx; }
28 class Mage : WorldObject { res = mageGfx; }
29 class Archer : WorldObject { res = archerGfx; }
30 class Castle : WorldObject { res = castleGfx; }
32 Array<WorldObject> objects
42 class MainWindow : Window
44 text = "A World of Objects";
46 borderStyle = sizable;
59 void OnUnloadGraphics()
70 void OnRedraw(Surface surface)
77 MainWindow mainWindow {};