From f8ca4a84518d442434e306e3c8f3503249e3c646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 11 Aug 2014 12:19:51 +0200 Subject: [PATCH] More maps & physics --- android/assets/map_pieces/p0_start.tmx | 968 ++++++++++++++++ android/assets/map_pieces/p0_template.tmx | 648 +++++++++++ android/assets/map_pieces/p1.tmx | 110 +- android/assets/map_pieces/p2.tmx | 274 ++--- android/assets/map_pieces/p3.tmx | 1024 +++++++++-------- android/assets/map_pieces/p4.tmx | 460 ++++---- android/assets/map_pieces/p5.tmx | 648 +++++++++++ android/assets/map_pieces/p6.tmx | 968 ++++++++++++++++ android/assets/map_pieces/p7.tmx | 648 +++++++++++ android/assets/map_pieces/p8.tmx | 648 +++++++++++ .../game/renderer/AbstractGameRenderer.java | 6 +- .../colorrunner/game/renderer/CRAssets.java | 8 + .../game/renderer/CRGameRenderer.java | 18 +- .../colorrunner/game/world/CRGameWorld.java | 8 +- .../game/world/entities/GravityEntity.java | 2 +- .../gameentities/floor/FloorTileEntity.java | 2 +- .../floor/NoStateFloorTileEntity.java | 25 + .../game/world/map/CRMapStorage.java | 15 +- .../game/world/map/CRTiledMap.java | 3 +- 19 files changed, 5576 insertions(+), 907 deletions(-) create mode 100644 android/assets/map_pieces/p0_start.tmx create mode 100644 android/assets/map_pieces/p0_template.tmx create mode 100644 android/assets/map_pieces/p5.tmx create mode 100644 android/assets/map_pieces/p6.tmx create mode 100644 android/assets/map_pieces/p7.tmx create mode 100644 android/assets/map_pieces/p8.tmx create mode 100644 core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/NoStateFloorTileEntity.java diff --git a/android/assets/map_pieces/p0_start.tmx b/android/assets/map_pieces/p0_start.tmx new file mode 100644 index 0000000..68cdabc --- /dev/null +++ b/android/assets/map_pieces/p0_start.tmx @@ -0,0 +1,968 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/assets/map_pieces/p0_template.tmx b/android/assets/map_pieces/p0_template.tmx new file mode 100644 index 0000000..7b2598c --- /dev/null +++ b/android/assets/map_pieces/p0_template.tmx @@ -0,0 +1,648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/assets/map_pieces/p1.tmx b/android/assets/map_pieces/p1.tmx index 281f5e8..38ad9b2 100644 --- a/android/assets/map_pieces/p1.tmx +++ b/android/assets/map_pieces/p1.tmx @@ -167,7 +167,6 @@ - @@ -188,7 +187,6 @@ - @@ -203,11 +201,9 @@ - - - - + + @@ -224,32 +220,52 @@ - - - - - - - - - - - - - - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -263,20 +279,19 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -291,21 +306,6 @@ - - - - - - - - - - - - - - - diff --git a/android/assets/map_pieces/p2.tmx b/android/assets/map_pieces/p2.tmx index e07b927..af8771b 100644 --- a/android/assets/map_pieces/p2.tmx +++ b/android/assets/map_pieces/p2.tmx @@ -171,7 +171,6 @@ - @@ -211,7 +210,6 @@ - @@ -251,7 +249,6 @@ - @@ -291,7 +288,6 @@ - @@ -331,7 +327,6 @@ - @@ -340,8 +335,6 @@ - - @@ -371,15 +364,101 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -411,88 +490,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -524,61 +522,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/assets/map_pieces/p3.tmx b/android/assets/map_pieces/p3.tmx index 2c35a90..fe38650 100644 --- a/android/assets/map_pieces/p3.tmx +++ b/android/assets/map_pieces/p3.tmx @@ -1,7 +1,7 @@ - + - + @@ -48,167 +48,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -223,74 +101,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -299,52 +109,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -360,22 +124,6 @@ - - - - - - - - - - - - - - - - @@ -384,183 +132,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -574,6 +145,7 @@ + @@ -581,6 +153,16 @@ + + + + + + + + + + @@ -588,13 +170,169 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -603,6 +341,348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/assets/map_pieces/p4.tmx b/android/assets/map_pieces/p4.tmx index 8174632..e6f8ebb 100644 --- a/android/assets/map_pieces/p4.tmx +++ b/android/assets/map_pieces/p4.tmx @@ -37,8 +37,228 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,242 +280,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -306,9 +311,6 @@ - - - @@ -316,8 +318,6 @@ - - diff --git a/android/assets/map_pieces/p5.tmx b/android/assets/map_pieces/p5.tmx new file mode 100644 index 0000000..3edd70c --- /dev/null +++ b/android/assets/map_pieces/p5.tmx @@ -0,0 +1,648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/assets/map_pieces/p6.tmx b/android/assets/map_pieces/p6.tmx new file mode 100644 index 0000000..2012fad --- /dev/null +++ b/android/assets/map_pieces/p6.tmx @@ -0,0 +1,968 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/assets/map_pieces/p7.tmx b/android/assets/map_pieces/p7.tmx new file mode 100644 index 0000000..bf8b343 --- /dev/null +++ b/android/assets/map_pieces/p7.tmx @@ -0,0 +1,648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/assets/map_pieces/p8.tmx b/android/assets/map_pieces/p8.tmx new file mode 100644 index 0000000..90d4859 --- /dev/null +++ b/android/assets/map_pieces/p8.tmx @@ -0,0 +1,648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/de/samdev/colorrunner/game/renderer/AbstractGameRenderer.java b/core/src/de/samdev/colorrunner/game/renderer/AbstractGameRenderer.java index b803a1e..dff6bea 100644 --- a/core/src/de/samdev/colorrunner/game/renderer/AbstractGameRenderer.java +++ b/core/src/de/samdev/colorrunner/game/renderer/AbstractGameRenderer.java @@ -13,7 +13,7 @@ public abstract class AbstractGameRenderer { public final static float MIN_GAME_WIDTH = 672; // ~ 512 * (4/3) public final static float MAX_GAME_WIDTH = 1024; // ~ 512 * (2/1) // ~~ 16:9 - private final static float FREE_ROAM_WIDTH = 1f/4f; + private final static float FREE_ROAM_WIDTH = 1f/2f; private int debugTextCount; @@ -42,8 +42,8 @@ public abstract class AbstractGameRenderer { } protected void updateCameraOffset(float lookAtX) { - if (lookAtX > cam.position.x + cam.viewportWidth * FREE_ROAM_WIDTH/2) { - cam.position.x += lookAtX - cam.position.x - cam.viewportWidth * FREE_ROAM_WIDTH/2; + if (lookAtX > cam.position.x - cam.viewportWidth * FREE_ROAM_WIDTH/2) { + cam.position.x += lookAtX - cam.position.x + cam.viewportWidth * FREE_ROAM_WIDTH/2; cam.update(); updateCamMatrices(); } diff --git a/core/src/de/samdev/colorrunner/game/renderer/CRAssets.java b/core/src/de/samdev/colorrunner/game/renderer/CRAssets.java index 499d3c5..cf7cd53 100644 --- a/core/src/de/samdev/colorrunner/game/renderer/CRAssets.java +++ b/core/src/de/samdev/colorrunner/game/renderer/CRAssets.java @@ -15,6 +15,7 @@ public class CRAssets { public static Texture TEX_FLOORTILE_DOWN; public static Texture TEX_FLOORTILE_LEFT; public static Texture TEX_FLOORTILE_RIGHT; + public static Texture TEX_FLOORTILE_STATELESS; public static Texture TEX_COLORWHEEL; @@ -74,6 +75,13 @@ public class CRAssets { pixmap.fill(); TEX_FLOORTILE_LEFT = new Texture(pixmap); } + + { + Pixmap pixmap = new Pixmap(64, 64, Format.RGBA8888); + pixmap.setColor(0, 0, 0, 1); + pixmap.fill(); + TEX_FLOORTILE_STATELESS = new Texture(pixmap); + } TEX_COLORWHEEL = new Texture(Gdx.files.internal("colorwheel.png")); } diff --git a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java index 7e50a09..8b1f213 100644 --- a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java +++ b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java @@ -28,18 +28,25 @@ public class CRGameRenderer extends AbstractGameRenderer { renderDebug("Entitys: " + gameworld.entities.size()); renderDebug("ExecTime: " + (int)(avgExecTime*100) / 100.0+ " / " + (int)(10000/gameworld.fps.getFPS())/10.0 + "ms (" + (int)((avgExecTime/(1000/gameworld.fps.getFPS()))*1000) / 10.0 + "%)"); endDebug(); + + //################################################################################ spriteBatch.begin(); - spriteBatch.enableBlending(); - Vector3 cw_coords = cam.unproject(new Vector3(Gdx.graphics.getWidth(), 0, 0)); - spriteBatch.draw(CRAssets.TEX_COLORWHEEL, cw_coords.x - 70, cw_coords.y - 70, 64, 64); - spriteBatch.disableBlending(); - for (CRGameEntity e : gameworld.entities) { spriteBatch.draw(e.getTexture(), e.bounds.x, e.bounds.y, e.bounds.width, e.bounds.height); } + + //################################################################################ + + spriteBatch.enableBlending(); + Vector3 cw_coords = cam.unproject(new Vector3(Gdx.graphics.getWidth(), 0, 0)); + spriteBatch.draw(CRAssets.TEX_COLORWHEEL, cw_coords.x - 70, cw_coords.y - 70, 64, 64); + spriteBatch.disableBlending(); + spriteBatch.end(); + + //################################################################################ shapeRenderer.begin(ShapeType.Line); shapeRenderer.setColor(1, 0, 1, 1); @@ -54,6 +61,7 @@ public class CRGameRenderer extends AbstractGameRenderer { shapeRenderer.line(me.bounds.getCenter(new Vector2()), me.bounds.getCenter(new Vector2()).add(0 , me.getVelocity().y / 15f)); } } + shapeRenderer.end(); } } diff --git a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java index 7d02581..66625b9 100644 --- a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java +++ b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java @@ -12,6 +12,7 @@ import de.samdev.colorrunner.game.world.entities.gameentities.PlayerEntity; import de.samdev.colorrunner.game.world.entities.gameentities.floor.DownStateFloorTileEntity; import de.samdev.colorrunner.game.world.entities.gameentities.floor.FloorTileEntity; import de.samdev.colorrunner.game.world.entities.gameentities.floor.LeftStateFloorTileEntity; +import de.samdev.colorrunner.game.world.entities.gameentities.floor.NoStateFloorTileEntity; import de.samdev.colorrunner.game.world.entities.gameentities.floor.RightStateFloorTileEntity; import de.samdev.colorrunner.game.world.entities.gameentities.floor.UpStateFloorTileEntity; import de.samdev.colorrunner.game.world.map.CRMapStorage; @@ -30,6 +31,7 @@ public class CRGameWorld implements GameInputListener { public CRGameWorld() { addEntity(player = new PlayerEntity(this, 40, 290)); + mapRightBoundary = appendMap(CRMapStorage.map_start, new Vector2(mapRightBoundary, 0)); expandMap(); } @@ -67,7 +69,8 @@ public class CRGameWorld implements GameInputListener { switch (map.getGID(x, y)) { - case CRTiledMap.GID_EMPTY: break; + case CRTiledMap.GID_EMPTY_1: break; + case CRTiledMap.GID_EMPTY_2: break; case CRTiledMap.GID_UP: addEntity(new UpStateFloorTileEntity(this, px, py)); @@ -81,6 +84,9 @@ public class CRGameWorld implements GameInputListener { case CRTiledMap.GID_LEFT: addEntity(new LeftStateFloorTileEntity(this, px, py)); break; + case CRTiledMap.GID_MID: + addEntity(new NoStateFloorTileEntity(this, px, py)); + break; default: Gdx.app.error("MapLoad", "Unknown GID: " + map.getGID(x, y)); diff --git a/core/src/de/samdev/colorrunner/game/world/entities/GravityEntity.java b/core/src/de/samdev/colorrunner/game/world/entities/GravityEntity.java index ed974f3..dc2d5b1 100644 --- a/core/src/de/samdev/colorrunner/game/world/entities/GravityEntity.java +++ b/core/src/de/samdev/colorrunner/game/world/entities/GravityEntity.java @@ -3,7 +3,7 @@ package de.samdev.colorrunner.game.world.entities; import de.samdev.colorrunner.game.world.CRGameWorld; public abstract class GravityEntity extends MovingEntity { - public final static float GRAVITY_FORCE = 600f; + public final static float GRAVITY_FORCE = 700f; public final static float TERMINAL_VELOCITY = 900f; public GravityEntity(CRGameWorld _owner, float width, float height) { diff --git a/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/FloorTileEntity.java b/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/FloorTileEntity.java index 0fd70a5..830d7cd 100644 --- a/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/FloorTileEntity.java +++ b/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/FloorTileEntity.java @@ -21,7 +21,7 @@ public abstract class FloorTileEntity extends StaticEntity { @Override public boolean canCollide(boolean actualCollision, CRGameEntity collider) { - if (collider instanceof PlayerEntity && ((PlayerEntity)collider).getPhase() == getPhase()) + if (collider instanceof PlayerEntity && (((PlayerEntity)collider).getPhase() == getPhase() || getPhase() == null)) return true; else return false; diff --git a/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/NoStateFloorTileEntity.java b/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/NoStateFloorTileEntity.java new file mode 100644 index 0000000..23ac38a --- /dev/null +++ b/core/src/de/samdev/colorrunner/game/world/entities/gameentities/floor/NoStateFloorTileEntity.java @@ -0,0 +1,25 @@ +package de.samdev.colorrunner.game.world.entities.gameentities.floor; + +import com.badlogic.gdx.graphics.Texture; + +import de.samdev.colorrunner.game.renderer.CRAssets; +import de.samdev.colorrunner.game.world.CRGameWorld; +import de.samdev.colorrunner.game.world.SwipeDirection; + +public class NoStateFloorTileEntity extends FloorTileEntity { + public final SwipeDirection PHASE = SwipeDirection.UP; + + public NoStateFloorTileEntity(CRGameWorld _owner, float x, float y) { + super(_owner, x, y); + } + + @Override + public Texture getTexture() { + return CRAssets.TEX_FLOORTILE_STATELESS; + } + + @Override + public SwipeDirection getPhase() { + return null; + } +} diff --git a/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java b/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java index 1bc10ab..7322cbd 100644 --- a/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java +++ b/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java @@ -9,15 +9,28 @@ import com.badlogic.gdx.Gdx; public class CRMapStorage { public static final Random random = new Random(); public static final List maps = new ArrayList(); + + public static final CRTiledMap map_start = register("p0_start.tmx", false); public static final CRTiledMap map_01 = register("p1.tmx"); public static final CRTiledMap map_02 = register("p2.tmx"); public static final CRTiledMap map_03 = register("p3.tmx"); public static final CRTiledMap map_04 = register("p4.tmx"); + public static final CRTiledMap map_05 = register("p5.tmx"); + public static final CRTiledMap map_06 = register("p6.tmx"); + public static final CRTiledMap map_07 = register("p7.tmx"); + public static final CRTiledMap map_08 = register("p8.tmx"); public static CRTiledMap register(String path) { + return register(path, true); + } + + public static CRTiledMap register(String path, boolean doRegister) { CRTiledMap m = CRTiledMap.load(Gdx.files.internal("map_pieces/" + path).readString()); - maps.add(m); + + if (doRegister) + maps.add(m); + return m; } diff --git a/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java b/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java index c9d0887..9752614 100644 --- a/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java +++ b/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java @@ -5,7 +5,8 @@ import com.badlogic.gdx.utils.XmlReader; import com.badlogic.gdx.utils.XmlReader.Element; public class CRTiledMap { - public final static int GID_EMPTY = 0; + public final static int GID_EMPTY_1 = 0; + public final static int GID_EMPTY_2 = 1; public final static int GID_MID = 13; public final static int GID_UP = 8;