Merge: gamnit: simple 2D API, input events and the game Asteronits
authorJean Privat <jean@pryen.org>
Wed, 16 Dec 2015 17:12:20 +0000 (12:12 -0500)
committerJean Privat <jean@pryen.org>
Wed, 16 Dec 2015 17:12:20 +0000 (12:12 -0500)
commitc86718ed33c02a612774f026b4b2ab18338ef96a
treee531b101f840ac95ec9b16f13577e649fba843a4
parentfb719859fb3a7b6a4ffce159000450786b802eed
parent6765cc94a6b9c2f9cf7ac7a6a50b288e35f55a1d
Merge: gamnit: simple 2D API, input events and the game Asteronits

You should probably read this PR commit by commit, it is a bit long but it's mostly due to the sample game, a big XML file and changes to indentation.

The new API provided by `simple_2d` is meant to replace mnit for writing 2D games.
Client modules only have to create instances of `Sprite` which will be displayed as long as they are in `App::sprites`.

At this point, the `simple_2d` API is not optimized and you may see a slowdown at the insertion of new sprites. However, we could improve the performance by preallocating buffer space for more sprites, and by caching sprites state on the GPU to avoid unnecessary updates.

This PR also adds support for input events for Linux and Android. It uses the existing services from `mnit::input`, `sdl` and `android::input_events`.

Finally, the game Asteronits is an example for the `simple_2d` API. In this game, the player controls a ship, avoids asteroids and destroys them. The gameplay and UI is limited by design to be a simple example. Note that the `touch_ui` variant is used on Android only but it also works on Linux.

The tool texture_atlas_parser reads XML TextureAtlas files and produces Nit classes with one attribute per subtexture. We could move this tool if it is useful for any other projects.

Pull-Request: #1894
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>