gamnit: move `flat` to a group
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 29 Jun 2017 13:30:43 +0000 (09:30 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 29 Jun 2017 13:40:23 +0000 (09:40 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/flat/flat.nit [new file with mode: 0644]
lib/gamnit/flat/flat_core.nit [moved from lib/gamnit/flat.nit with 97% similarity]

diff --git a/lib/gamnit/flat/flat.nit b/lib/gamnit/flat/flat.nit
new file mode 100644 (file)
index 0000000..6d39f6b
--- /dev/null
@@ -0,0 +1,36 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Simple API for 2D games, built around `Sprite` and `App::update`
+#
+# Client programs should implement `App::update` to execute game logic and
+# add instances of `Sprite` to `App::sprites` and `App::ui_sprites`.
+# At each frame, all sprites are drawn to the screen.
+#
+# This system relies on two cameras `App::world_camera` and `App::ui_camera`.
+#
+# * `App::world_camera` applies a perspective effect to draw the game world.
+#   This camera is designed to be moved around to see the world as well as to
+#   zoom in and out. It is used to position the sprites in `App::sprites`.
+#
+# * `App::ui_camera` is a simple orthogonal camera to display UI objects.
+#   This camera should mostly be still, it can still move for chock effects
+#   and the like. It can be used to standardize the size of the UI across
+#   devices. It is used to position the sprites in `App::ui_sprites`.
+#
+# See the sample game at `contrib/asteronits/` and the basic project template
+# at `lib/gamnit/examples/template/`.
+module flat
+
+import gamnit::flat_core
similarity index 97%
rename from lib/gamnit/flat.nit
rename to lib/gamnit/flat/flat_core.nit
index 3911092..cd1d11d 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Simple API for 2D games, built around `Sprite` and `App::update`
-#
-# Client programs should implement `App::update` to execute game logic and
-# add instances of `Sprite` to `App::sprites` and `App::ui_sprites`.
-# At each frame, all sprites are drawn to the screen.
-#
-# This system relies on two cameras `App::world_camera` and `App::ui_camera`.
-#
-# * `App::world_camera` applies a perspective effect to draw the game world.
-#   This camera is designed to be moved around to see the world as well as to
-#   zoom in and out. It is used to position the sprites in `App::sprites`.
-#
-# * `App::ui_camera` is a simple orthogonal camera to display UI objects.
-#   This camera should mostly be still, it can still move for chock effects
-#   and the like. It can be used to standardize the size of the UI across
-#   devices. It is used to position the sprites in `App::ui_sprites`.
-#
-# See the sample game at `contrib/asteronits/` and the basic project template
-# at `lib/gamnit/examples/template/`.
-module flat
+# Core services for the `flat` API for 2D games
+module flat_core
 
 import glesv2
 intrude import geometry::points_and_lines # For _x, _y and _z