comparison README.md @ 447:e1fa1b867281

cmake: resurrection Using GNU make for such a big project is tedious.
author David Demelier <markand@malikania.fr>
date Sat, 18 Feb 2023 12:43:05 +0100
parents 2862526f1fc9
children e070fdcc592b
comparison
equal deleted inserted replaced
446:4607eea0eabc 447:e1fa1b867281
9 - Written in C99, 9 - Written in C99,
10 - Portable (Windows, macOS and UNIX likes systems), 10 - Portable (Windows, macOS and UNIX likes systems),
11 - Simple, flexible, 11 - Simple, flexible,
12 - Well documented, 12 - Well documented,
13 - Virtual file system support. 13 - Virtual file system support.
14 - Usable in both C or Javascript.
14 - Can embed resources using `mlk-bcc`. 15 - Can embed resources using `mlk-bcc`.
16
17 Javascript quick startup
18 ------------------------
19
20 The `mlk-run` executable exposes the Javascript API and start a game from a
21 directory or a .mlk file (which is a .zip file with a .mlk extension).
22
23 Hello world in Javascript:
24
25 mkdir superluigi
26
27 Add the following content in superluigi/main.js:
28
29 ```js
30 var w = new Window("Super Luigi, number one", 640, 480);
31 var run = true;
32
33 while (run) {
34 var ev;
35
36 while ((ev = Event.poll())) {
37 switch (ev.type) {
38 case Event.Type.QUIT:
39 run = false;
40 break;
41 default:
42 break;
43 }
44
45 Painter.color = 0xFFFFFFFF;
46 Painter.clear();
47 Painter.present();
48 }
49 }
50 ```
51
52 Finally run the game using `mlk-run superluigi`.
53
54 You can also create a .zip file with a .mlk extension and `mlk-run` will be able
55 to use content from it.
56
57 cd superluigi
58 zip -r ../superluigi.mlk .
59 cd ..
60 mlk-run superluigi.mlk
15 61
16 Documentation 62 Documentation
17 ------------- 63 -------------
18 64
19 Use `mkdocs serve` inside the **doc** directory to see the user and developer 65 Use `mkdocs serve` inside the **doc** directory to see the user and developer