| … | … | @@ -29,7 +29,6 @@ func updateMapWorldEnvironmentScene(): |
| 29 | 29 | var worldEnvironment = getInstanceOfMapWorldEnvironmentScene() |
| 30 | 30 | if(worldEnvironment != null): |
| 31 | 31 | add_child(worldEnvironment.instance()) |
| 32 | pass | |
| 33 | 32 | |
| 34 | 33 | func addGrapplingHookCollisionMaskToMap(): |
| 35 | 34 | var _name = self.name |
| … | … | @@ -54,4 +53,5 @@ func _on_Area_body_entered(body, map_name): |
| 54 | 53 | if(body is KinematicBody): |
| 55 | 54 | var mapNode = get_tree().get_current_scene().find_node(map_name, true, false) |
| 56 | 55 | body.currentMap = mapNode |
| 56 | body.playerWantsNewWorldEnvironment = true | |
| 57 | 57 |
| … | … | @@ -57,6 +57,7 @@ teleportation_destination = "map_test" |
| 57 | 57 | [node name="CollisionShape" type="CollisionShape" parent="Area"] |
| 58 | 58 | transform = Transform( 1000, 0, 0, 0, 1000, 0, 0, 0, 1000, 0, 0, 0 ) |
| 59 | 59 | shape = SubResource( 10 ) |
| 60 | disabled = true | |
| 60 | 61 | |
| 61 | 62 | [node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."] |
| 62 | 63 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 38.275, 0 ) |
| … | … | @@ -67,4 +68,6 @@ pitch_scale = 1.36 |
| 67 | 68 | autoplay = true |
| 68 | 69 | max_distance = 2000.0 |
| 69 | 70 | |
| 71 | [connection signal="body_entered" from="Area" to="." method="_on_Area_body_entered" binds= [ "map_cyber" ]] | |
| 72 | ||
| 70 | 73 | [editable path="asset_map_cyber"] |
| … | … | @@ -204,6 +204,11 @@ func _physics_process(_delta): |
| 204 | 204 | respawnPlayer() |
| 205 | 205 | return |
| 206 | 206 | |
| 207 | # Check for New World Environment | |
| 208 | if(playerWantsNewWorldEnvironment): | |
| 209 | playerWantsNewWorldEnvironment = false | |
| 210 | currentMap.updateMapWorldEnvironmentScene() | |
| 211 | ||
| 207 | 212 | # Moving the character |
| 208 | 213 | var y_cache : float = kinematicVelocity.y |
| 209 | 214 | kinematicVelocity = kinematicVelocity.linear_interpolate(currentDirection * movementSpeed, movementAcceleration * _delta) |
| … | … | @@ -294,12 +299,6 @@ func respawnPlayer(): |
| 294 | 299 | playerWantsToReleaseGrapplingHook = true |
| 295 | 300 | $Model/Sound_Teleport_1.play() |
| 296 | 301 | global_transform.origin = currentSpawnLocation |
| 297 | ||
| 298 | # Check for New World Environment | |
| 299 | if(playerWantsNewWorldEnvironment): | |
| 300 | playerWantsNewWorldEnvironment = false | |
| 301 | currentMap.updateMapWorldEnvironmentScene() | |
| 302 | # translation = ( get_tree().get_current_scene().getSpawnLocation() )# ) = currentSpawnLocation | |
| 303 | 302 | |
| 304 | 303 | func playerCanJump() -> bool: |
| 305 | 304 | if( self.is_on_floor() ): |
| … | … | @@ -27,6 +27,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 357.971, 3.8147e-06, 43.2013 ) |
| 27 | 27 | [node name="Players" type="Node" parent="."] |
| 28 | 28 | |
| 29 | 29 | [node name="PlayerLocal" parent="Players" instance=ExtResource( 2 )] |
| 30 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 69.4813, -3.05659, 181.497 ) | |
| 30 | 31 | |
| 31 | 32 | [node name="HyperGodot" type="Node" parent="."] |
| 32 | 33 | script = ExtResource( 6 ) |