From 14d8a73c02afc86c8347382a36797391e450398d Mon Sep 17 00:00:00 2001 From: rsninja722 Date: Mon, 4 Apr 2022 00:47:18 -0400 Subject: [PATCH] fixes --- .../{env_cars => env_car}/env_carBlue.json | 8 +- .../env/{env_cars => env_car}/env_carBlue.png | Bin .../{env_cars => env_car}/env_carGrey.json | 4 +- .../env/{env_cars => env_car}/env_carGrey.png | Bin .../{env_cars => env_car}/env_carOrange.json | 4 +- .../{env_cars => env_car}/env_carOrange.png | Bin .../{env_cars => env_car}/env_carWheels.png | Bin .../env/env_market/env_marketPurple.json | 36 ++---- .../assets/env/env_market/env_marketRed.json | 36 ++---- .../env/env_market/env_marketYellow.json | 36 ++---- .../assets/env/env_person/env_person2.json | 2 +- .../env_tronkDark.json | 0 .../{env_cars => env_tronk}/env_tronkDark.png | Bin .../env_tronkLight.json | 0 .../env_tronkLight.png | Bin .../env_tronkWheels.png | Bin game/dist/map_gameMap.objects.json | 117 +++++++++++++----- game/dist/map_gameMap.tmx | 32 ++--- .../src/rendering/utilities/map_render.rs | 9 ++ .../src/scenes/player_interaction.rs | 10 +- 20 files changed, 166 insertions(+), 128 deletions(-) rename game/dist/assets/env/{env_cars => env_car}/env_carBlue.json (85%) rename game/dist/assets/env/{env_cars => env_car}/env_carBlue.png (100%) rename game/dist/assets/env/{env_cars => env_car}/env_carGrey.json (90%) rename game/dist/assets/env/{env_cars => env_car}/env_carGrey.png (100%) rename game/dist/assets/env/{env_cars => env_car}/env_carOrange.json (90%) rename game/dist/assets/env/{env_cars => env_car}/env_carOrange.png (100%) rename game/dist/assets/env/{env_cars => env_car}/env_carWheels.png (100%) rename game/dist/assets/env/{env_cars => env_tronk}/env_tronkDark.json (100%) rename game/dist/assets/env/{env_cars => env_tronk}/env_tronkDark.png (100%) rename game/dist/assets/env/{env_cars => env_tronk}/env_tronkLight.json (100%) rename game/dist/assets/env/{env_cars => env_tronk}/env_tronkLight.png (100%) rename game/dist/assets/env/{env_cars => env_tronk}/env_tronkWheels.png (100%) diff --git a/game/dist/assets/env/env_cars/env_carBlue.json b/game/dist/assets/env/env_car/env_carBlue.json similarity index 85% rename from game/dist/assets/env/env_cars/env_carBlue.json rename to game/dist/assets/env/env_car/env_carBlue.json index 7dad39db..07551bd3 100644 --- a/game/dist/assets/env/env_cars/env_carBlue.json +++ b/game/dist/assets/env/env_car/env_carBlue.json @@ -1,10 +1,10 @@ { "name": "env_carBlue", "bottom_texture": { - "file_path": "assets/env/env_cars/env_carWheels.png" + "file_path": "assets/env/env_car/env_carWheels.png" }, "top_texture": { - "file_path": "assets/env/env_cars/env_carBlue.png" + "file_path": "assets/env/env_car/env_carBlue.png" }, "footprint": [ { @@ -18,7 +18,7 @@ ] } ], - "visualization_radius": 220.0, + "visualization_radius": 220, "physics_colliders": [ { "position": [ @@ -61,5 +61,5 @@ ] } ], - "temperature": 7.0 + "temperature": 7 } \ No newline at end of file diff --git a/game/dist/assets/env/env_cars/env_carBlue.png b/game/dist/assets/env/env_car/env_carBlue.png similarity index 100% rename from game/dist/assets/env/env_cars/env_carBlue.png rename to game/dist/assets/env/env_car/env_carBlue.png diff --git a/game/dist/assets/env/env_cars/env_carGrey.json b/game/dist/assets/env/env_car/env_carGrey.json similarity index 90% rename from game/dist/assets/env/env_cars/env_carGrey.json rename to game/dist/assets/env/env_car/env_carGrey.json index 4584d8bb..6a26d80e 100644 --- a/game/dist/assets/env/env_cars/env_carGrey.json +++ b/game/dist/assets/env/env_car/env_carGrey.json @@ -1,10 +1,10 @@ { "name": "env_carGrey", "bottom_texture": { - "file_path": "assets/env/env_cars/env_carWheels.png" + "file_path": "assets/env/env_car/env_carWheels.png" }, "top_texture": { - "file_path": "assets/env/env_cars/env_carGrey.png" + "file_path": "assets/env/env_car/env_carGrey.png" }, "footprint": [ { diff --git a/game/dist/assets/env/env_cars/env_carGrey.png b/game/dist/assets/env/env_car/env_carGrey.png similarity index 100% rename from game/dist/assets/env/env_cars/env_carGrey.png rename to game/dist/assets/env/env_car/env_carGrey.png diff --git a/game/dist/assets/env/env_cars/env_carOrange.json b/game/dist/assets/env/env_car/env_carOrange.json similarity index 90% rename from game/dist/assets/env/env_cars/env_carOrange.json rename to game/dist/assets/env/env_car/env_carOrange.json index 34269be5..9f8f7b20 100644 --- a/game/dist/assets/env/env_cars/env_carOrange.json +++ b/game/dist/assets/env/env_car/env_carOrange.json @@ -1,10 +1,10 @@ { "name": "env_carOrange", "bottom_texture": { - "file_path": "assets/env/env_cars/env_carWheels.png" + "file_path": "assets/env/env_car/env_carWheels.png" }, "top_texture": { - "file_path": "assets/env/env_cars/env_carOrange.png" + "file_path": "assets/env/env_car/env_carOrange.png" }, "footprint": [ { diff --git a/game/dist/assets/env/env_cars/env_carOrange.png b/game/dist/assets/env/env_car/env_carOrange.png similarity index 100% rename from game/dist/assets/env/env_cars/env_carOrange.png rename to game/dist/assets/env/env_car/env_carOrange.png diff --git a/game/dist/assets/env/env_cars/env_carWheels.png b/game/dist/assets/env/env_car/env_carWheels.png similarity index 100% rename from game/dist/assets/env/env_cars/env_carWheels.png rename to game/dist/assets/env/env_car/env_carWheels.png diff --git a/game/dist/assets/env/env_market/env_marketPurple.json b/game/dist/assets/env/env_market/env_marketPurple.json index f013f9ad..3b775aca 100644 --- a/game/dist/assets/env/env_market/env_marketPurple.json +++ b/game/dist/assets/env/env_market/env_marketPurple.json @@ -22,21 +22,21 @@ "physics_colliders": [ { "position": [ - 44, - 246 + 50, + -246 ], "size": [ - 60, + 140, 20 ] }, { "position": [ - 157, - 246 + -157, + -246 ], "size": [ - 200, + 190, 20 ] }, @@ -52,22 +52,12 @@ }, { "position": [ - -103, - -62 + -100, + -50 ], "size": [ - 95, - 35 - ] - }, - { - "position": [ - -188, - -216 - ], - "size": [ - 396, - 77 + 77, + 370 ] }, { @@ -76,13 +66,13 @@ -51 ], "size": [ - 340, - 17 + 17, + 340 ] }, { "position": [ - 44, + 74, -10 ], "size": [ diff --git a/game/dist/assets/env/env_market/env_marketRed.json b/game/dist/assets/env/env_market/env_marketRed.json index 6af4805f..b489ee48 100644 --- a/game/dist/assets/env/env_market/env_marketRed.json +++ b/game/dist/assets/env/env_market/env_marketRed.json @@ -22,21 +22,21 @@ "physics_colliders": [ { "position": [ - 44, - 246 + 50, + -246 ], "size": [ - 60, + 140, 20 ] }, { "position": [ - 157, - 246 + -157, + -246 ], "size": [ - 200, + 190, 20 ] }, @@ -52,22 +52,12 @@ }, { "position": [ - -103, - -62 + -100, + -50 ], "size": [ - 95, - 35 - ] - }, - { - "position": [ - -188, - -216 - ], - "size": [ - 396, - 77 + 77, + 370 ] }, { @@ -76,13 +66,13 @@ -51 ], "size": [ - 340, - 17 + 17, + 340 ] }, { "position": [ - 44, + 74, -10 ], "size": [ diff --git a/game/dist/assets/env/env_market/env_marketYellow.json b/game/dist/assets/env/env_market/env_marketYellow.json index 545ae89d..4e52893d 100644 --- a/game/dist/assets/env/env_market/env_marketYellow.json +++ b/game/dist/assets/env/env_market/env_marketYellow.json @@ -22,21 +22,21 @@ "physics_colliders": [ { "position": [ - 44, - 246 + 50, + -246 ], "size": [ - 60, + 140, 20 ] }, { "position": [ - 157, - 246 + -157, + -246 ], "size": [ - 200, + 190, 20 ] }, @@ -52,22 +52,12 @@ }, { "position": [ - -103, - -62 + -100, + -50 ], "size": [ - 95, - 35 - ] - }, - { - "position": [ - -188, - -216 - ], - "size": [ - 396, - 77 + 77, + 370 ] }, { @@ -76,13 +66,13 @@ -51 ], "size": [ - 340, - 17 + 17, + 340 ] }, { "position": [ - 44, + 74, -10 ], "size": [ diff --git a/game/dist/assets/env/env_person/env_person2.json b/game/dist/assets/env/env_person/env_person2.json index b1d2c89b..e0df2d6a 100644 --- a/game/dist/assets/env/env_person/env_person2.json +++ b/game/dist/assets/env/env_person/env_person2.json @@ -4,7 +4,7 @@ "file_path": "assets/env/env_person/env_blank.png" }, "top_texture": { - "file_path": "assets/env/env_person/env_person1.png" + "file_path": "assets/env/env_person/env_personSit1.png" }, "footprint":[ { diff --git a/game/dist/assets/env/env_cars/env_tronkDark.json b/game/dist/assets/env/env_tronk/env_tronkDark.json similarity index 100% rename from game/dist/assets/env/env_cars/env_tronkDark.json rename to game/dist/assets/env/env_tronk/env_tronkDark.json diff --git a/game/dist/assets/env/env_cars/env_tronkDark.png b/game/dist/assets/env/env_tronk/env_tronkDark.png similarity index 100% rename from game/dist/assets/env/env_cars/env_tronkDark.png rename to game/dist/assets/env/env_tronk/env_tronkDark.png diff --git a/game/dist/assets/env/env_cars/env_tronkLight.json b/game/dist/assets/env/env_tronk/env_tronkLight.json similarity index 100% rename from game/dist/assets/env/env_cars/env_tronkLight.json rename to game/dist/assets/env/env_tronk/env_tronkLight.json diff --git a/game/dist/assets/env/env_cars/env_tronkLight.png b/game/dist/assets/env/env_tronk/env_tronkLight.png similarity index 100% rename from game/dist/assets/env/env_cars/env_tronkLight.png rename to game/dist/assets/env/env_tronk/env_tronkLight.png diff --git a/game/dist/assets/env/env_cars/env_tronkWheels.png b/game/dist/assets/env/env_tronk/env_tronkWheels.png similarity index 100% rename from game/dist/assets/env/env_cars/env_tronkWheels.png rename to game/dist/assets/env/env_tronk/env_tronkWheels.png diff --git a/game/dist/map_gameMap.objects.json b/game/dist/map_gameMap.objects.json index 0870658c..234b5332 100644 --- a/game/dist/map_gameMap.objects.json +++ b/game/dist/map_gameMap.objects.json @@ -1,31 +1,82 @@ [ { "type": "env", - "name": "env_umbrella", - "variant": "Blue", - "position": [ - 5, - 7 - ], - "rotation_degrees": 90 - }, - { - "type": "env", - "name": "env_umbrella", - "variant": "RedTowels", - "position": [ - 7, - 7 - ], - "rotation_degrees": 180 - }, - { - "type": "env", - "name": "env_towel", + "name": "env_market", "variant": "Red", "position": [ - 6, - 9 + 14,120 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Yellow", + "position": [ + 14,115 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Purple", + "position": [ + 14,110 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Red", + "position": [ + 20,105 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Yellow", + "position": [ + 20,96 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Yellow", + "position": [ + 19,46 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Purple", + "position": [ + 19,32 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Purple", + "position": [ + 20,76 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_market", + "variant": "Yellow", + "position": [ + 15,15 ], "rotation_degrees": 0 }, @@ -34,17 +85,25 @@ "name": "env_chair", "variant": "Dark", "position": [ - 4, - 9 + 4,124 ], - "rotation_degrees": -90 + "rotation_degrees": 0 }, { "type": "env", - "name": "env_market", - "variant": "Red", + "name": "env_chair", + "variant": "Dark", "position": [ - 14,14 + 6,124 + ], + "rotation_degrees": 0 + }, + { + "type": "env", + "name": "env_chair", + "variant": "Light", + "position": [ + 19,119 ], "rotation_degrees": 0 } diff --git a/game/dist/map_gameMap.tmx b/game/dist/map_gameMap.tmx index 7f984fd0..5d2bfa60 100644 --- a/game/dist/map_gameMap.tmx +++ b/game/dist/map_gameMap.tmx @@ -522,10 +522,10 @@ 4,29,29,48,49,29,29,29,29,29,29,29,29,50,51,29,29,29,29,29,50,51,29,29,29,59,52,52,52,52,52,52, 4,29,29,29,29,29,50,41,51,29,29,29,29,48,49,50,51,50,41,51,48,49,50,51,50,59,52,52,52,52,52,52, 4,29,29,29,50,51,44,24,40,51,29,29,29,29,50,42,40,42,24,40,41,41,42,43,44,59,52,52,52,52,52,52, -4,29,29,29,48,49,44,24,24,40,41,41,51,50,42,24,24,24,24,24,24,24,24,40,42,59,52,52,52,52,52,52, -4,29,29,29,29,29,44,24,24,24,24,24,40,42,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -2,7,29,29,29,29,44,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -5,1,29,29,29,29,48,47,24,24,24,19,20,20,20,20,20,20,20,20,20,20,20,20,20,59,52,52,52,52,52,52, +4,29,29,29,48,49,44,24,24,40,41,41,51,50,42,24,19,20,21,24,24,24,24,40,42,59,52,52,52,52,52,52, +4,29,29,29,29,29,44,24,24,24,24,24,40,42,24,24,17,9,18,24,24,24,24,24,24,59,52,52,52,52,52,52, +2,7,29,29,29,29,44,24,24,24,24,24,24,24,24,24,17,9,18,24,24,24,24,24,24,59,52,52,52,52,52,52, +5,1,29,29,29,29,48,47,24,24,24,19,20,20,20,20,23,9,22,20,20,20,20,20,20,59,52,52,52,52,52,52, 4,29,29,29,29,29,29,44,24,24,24,17,9,9,9,9,9,9,9,9,9,9,9,9,9,59,52,52,52,52,52,52, 2,7,29,29,29,29,50,42,24,24,24,17,9,9,9,9,9,9,9,9,9,9,9,9,9,59,52,52,52,52,52,52, 68,2,3,3,7,29,48,46,54,54,54,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,52,52,52,52,52,52, @@ -617,20 +617,20 @@ 68,68,4,29,29,29,29,50,41,41,42,24,24,24,24,24,24,24,24,24,24,17,9,18,24,59,52,52,52,52,52,52, 68,68,4,29,29,29,29,48,47,24,19,20,20,20,20,20,20,20,20,20,20,23,9,18,24,59,52,52,52,52,52,52, 68,68,2,7,29,29,50,41,42,24,17,9,9,9,9,9,9,9,9,9,9,9,9,18,24,59,52,52,52,52,52,52, -68,68,5,1,29,29,48,47,24,24,17,9,25,15,15,15,15,15,15,15,15,15,15,16,24,59,52,52,52,52,52,52, -68,68,4,29,29,29,29,44,24,24,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -68,5,1,29,29,29,50,42,24,24,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -68,4,29,29,29,29,48,47,24,24,17,9,22,20,20,20,20,20,20,20,20,20,20,21,24,59,52,52,52,52,52,52, +68,68,5,1,29,29,48,47,24,24,17,9,25,15,26,9,25,15,15,15,15,15,15,16,24,59,52,52,52,52,52,52, +68,68,4,29,29,29,29,44,24,24,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +68,5,1,29,29,29,50,42,24,24,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +68,4,29,29,29,29,48,47,24,24,17,9,22,20,23,9,22,20,20,20,20,20,20,21,24,59,52,52,52,52,52,52, 68,4,29,29,29,29,29,44,24,24,17,9,9,9,9,9,9,9,9,9,9,9,9,18,24,59,52,52,52,52,52,52, -68,4,29,29,29,29,29,48,47,24,17,9,25,15,15,15,15,15,15,15,15,15,15,16,24,59,52,52,52,52,52,52, -68,4,29,29,29,29,29,29,44,24,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -5,1,29,29,29,29,29,29,44,24,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -4,29,29,29,29,29,29,29,44,24,17,9,22,20,20,20,20,21,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +68,4,29,29,29,29,29,48,47,24,17,9,25,15,26,9,25,15,15,15,15,15,15,16,24,59,52,52,52,52,52,52, +68,4,29,29,29,29,29,29,44,24,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +5,1,29,29,29,29,29,29,44,24,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +4,29,29,29,29,29,29,29,44,24,17,9,22,20,23,9,22,21,24,24,24,24,24,24,24,59,52,52,52,52,52,52, 4,29,29,29,29,29,29,29,44,24,17,9,9,9,9,9,9,18,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -4,29,29,29,29,29,29,29,48,47,17,9,25,15,15,15,15,16,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -2,3,7,29,29,29,29,29,29,44,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -5,6,1,29,29,29,29,29,29,44,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, -4,29,29,29,29,29,29,29,29,48,17,9,18,24,24,24,24,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +4,29,29,29,29,29,29,29,48,47,17,9,25,15,26,9,25,16,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +2,3,7,29,29,29,29,29,29,44,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +5,6,1,29,29,29,29,29,29,44,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, +4,29,29,29,29,29,29,29,29,48,17,9,18,24,17,9,18,24,24,24,24,24,24,24,24,59,52,52,52,52,52,52, 2,7,29,29,29,29,29,29,29,29,14,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,52,52,52,52,52,52, 5,1,29,29,29,29,29,29,29,50,24,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,52,52,52,52,52,52, 4,29,29,29,29,29,29,29,29,44,24,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,52,52,52,52,52,52, diff --git a/game/game_logic/src/rendering/utilities/map_render.rs b/game/game_logic/src/rendering/utilities/map_render.rs index 93708e60..31d4a457 100644 --- a/game/game_logic/src/rendering/utilities/map_render.rs +++ b/game/game_logic/src/rendering/utilities/map_render.rs @@ -483,6 +483,15 @@ impl MapRenderer { } } } + // for collider in &self.world_objects.world_space_colliders { + // draw_handle.draw_rectangle_lines( + // (collider.position.x-collider.size.x/2.0) as i32, + // -(collider.position.y+collider.size.y/2.0) as i32, + // collider.size.x as i32, + // collider.size.y as i32, + // Color::BLUEVIOLET, + // ); + // } } tiled::LayerType::ObjectLayer(_) => todo!(), tiled::LayerType::ImageLayer(_) => todo!(), diff --git a/game/game_logic/src/scenes/player_interaction.rs b/game/game_logic/src/scenes/player_interaction.rs index 9ff4ab04..2ba5de25 100644 --- a/game/game_logic/src/scenes/player_interaction.rs +++ b/game/game_logic/src/scenes/player_interaction.rs @@ -289,9 +289,9 @@ impl PlayableScene { for i in &self.world_colliders { if player.position.x - player_size <= i.position.x + i.size.x / 2.0 - && player.position.x + player_size >= i.position.x + i.size.x / 2.0 + && player.position.x + player_size >= i.position.x - i.size.x / 2.0 && player.position.y - player_size <= i.position.y + i.size.y / 2.0 - && player.position.y + player_size >= i.position.y + i.size.y / 2.0 + && player.position.y + player_size >= i.position.y - i.size.y / 2.0 { // if player.velocity.x < 0.0 { // player.position.x = i.position.x + i.size.x / 2.0 + player_size; @@ -320,9 +320,9 @@ impl PlayableScene { for i in &self.world_colliders { if player.position.x - player_size <= i.position.x + i.size.x / 2.0 - && player.position.x + player_size >= i.position.x + i.size.x / 2.0 - && player.position.y - player_size <= i.position.y + i.size.y / 2.0 - && player.position.y + player_size >= i.position.y + i.size.y / 2.0 + && player.position.x + player_size >= i.position.x - i.size.x / 2.0 + && player.position.y - player_size <= i.position.y + i.size.y / 2.0 + && player.position.y + player_size >= i.position.y - i.size.y / 2.0 { // if player.velocity.y < 0.0 { // player.position.y = i.position.y + i.size.y / 2.0 + player_size;