comparison import/myrrdin/test.d @ 5:f4b89014ad39

added moving figure stuff + animated sprites. not usable atm.
author fred@reichbier.de
date Sat, 19 Jul 2008 14:33:08 +0200
parents src/test.d@292df259cc85
children 510541745cd1
comparison
equal deleted inserted replaced
4:292df259cc85 5:f4b89014ad39
1 /*
2 This file is part of myrrdin.
3
4 myrrdin is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation, either version 3 of
7 the License, or (at your option) any later version.
8
9 myrrdin is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with myrrdin. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 module test;
19
20 import dsfml.window.all;
21 import dsfml.system.all;
22 import dsfml.graphics.all;
23
24 import tileconsumer;
25 import renderer;
26 import consumer;
27 import imagecache;
28 import tilemap;
29 import tileset;
30 import xmlmap;
31 import tools;
32 import viewconsumer;
33 import animatedsprite;
34 import spriteconsumer;
35 import movingfigure;
36
37 int main(char[][] args) {
38 Cache cache = new Cache("gfx");
39 Tilemap map = parse_map(cache, read_file_contents("map-example.xml"));
40 Renderer render = new Renderer("Blubb", 600, 480, 32);
41 // render.add_consumer(new InteractiveViewConsumer(render));
42 TileConsumer consumer = new TileConsumer(render, map);
43 map.set_view(render.app.getView());
44 render.add_consumer(consumer);
45 render.add_consumer(load_charset(render, cache, "f-", ".png", 10));
46 /* SpriteConsumer c = new SpriteConsumer(render);
47 AnimatedSprite s = new AnimatedSprite;
48 s.setX(10);
49 s.setY(10);
50 Animation a = new Animation;
51 a.add_frame(map.tileset.tiles[0], 10);
52 a.add_frame(map.tileset.tiles[1], 10);
53 // s.setImage(map.tileset.tiles[0]);
54 s.play_animation(a, true);
55 c.add_sprite(s);
56 render.add_consumer(c);*/
57
58 render.mainloop();
59 return 0;
60 }