OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-tps_demo commits / 195e226

added in portals that can change which game you are running
195e226fa8056bdf2f29ae44878fc29247ff336e
by plankatron <fleeky@gmail.com> · 2022-05-05T18:04:37.000Z

Changed files (7) +56 -51

game/map_decorations/portal.gd +5 -39
……@@ -1,52 +1,18 @@
11extends Spatial
22
3export var teleportation_destination : String = ""
4
5onready var mapsNode : Node = get_tree().get_current_scene().get_node("Maps")
6
7
8# Declare member variables here. Examples:
9# var a = 2
10# var b = "text"
11
3export var portal_destination : String = ""
124
135# Called when the node enters the scene tree for the first time.
146func _ready():
157 pass # Replace with function body.
16
17func _on_Teleporter_gameplay_entered():
18 pass
19
20
21func tryMapChange(mapChangeName : String, sendGossip : bool, playerNode):
22 var mapCurrentName = playerNode.currentMap.map_name
23 var mapNode = null
24 if(mapCurrentName != teleportation_destination):
25 if(mapChangeName == "map_test"):
26 mapNode = mapsNode.find_node("map_test", true, false)
27 elif(mapChangeName == "map_cyber"):
28 mapNode = mapsNode.find_node("map_cyber", true, false)
29 elif(mapChangeName == "map_cyber1"):
30 mapNode = mapsNode.find_node("map_cyber1", true, false)
31 # Find a Respawn Point
32 playerNode.currentSpawnLocation = playerNode.getSpawnLocationForMapName(mapChangeName)
33 playerNode.currentMap = mapNode
34 playerNode.playerWantsToRespawn = true
35 playerNode.playerWantsNewWorldEnvironment = true
36
37 if(sendGossip):
38 var data : Dictionary = {
39 "map": {
40 "name": mapChangeName
41 }
42 }
43 #hyperGossip.broadcast_event(EVENT_PLAYER_MAPCHANGE, data)
448
9func tryGameChange(mapChangeName : String, sendGossip : bool, playerNode):
10 OS.execute(OS.get_executable_path(), ["--main-pack", portal_destination], false)
11 get_tree().quit()
4512
4613func _on_CollisionShape_gameplay_entered():
4714 pass # Replace with function body.
4815
49
5016func _on_Hitbox_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
5117 if(body is KinematicBody):
52 tryMapChange(teleportation_destination, true, body)
18 tryGameChange(portal_destination, true, body)
game/map_decorations/portal.tscn +6 -7
……@@ -1,22 +1,21 @@
11[gd_scene load_steps=4 format=2]
22
33[ext_resource path="res://assets/models/portal/portal.tscn" type="PackedScene" id=1]
4[ext_resource path="res://game/map_decorations/teleporter.gd" type="Script" id=2]
4[ext_resource path="res://game/map_decorations/portal.gd" type="Script" id=2]
55
6[sub_resource type="CylinderShape" id=1]
7radius = 2.5
6[sub_resource type="BoxShape" id=1]
7extents = Vector3( 2, 1, 2 )
88
9[node name="Teleporter" type="Spatial"]
9[node name="Portal" type="Spatial"]
1010script = ExtResource( 2 )
11teleportation_destination = "map_test"
1211
1312[node name="Hitbox" type="Area" parent="."]
1413transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6015, -0.00169456 )
1514
1615[node name="CollisionShape" type="CollisionShape" parent="Hitbox"]
17transform = Transform( 1, 0, -4.37114e-08, -4.37114e-08, 1.91069e-15, -1, 0, 1, 1.91069e-15, 0, -1.60972, 0 )
16transform = Transform( 1, 0, -4.37114e-08, -4.37114e-08, 1.91069e-15, -1, 0, 1, 1.91069e-15, -0.0218629, -1.60972, 0.0110197 )
1817shape = SubResource( 1 )
1918
2019[node name="portal" parent="." instance=ExtResource( 1 )]
2120
22[connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"]
21[connection signal="body_shape_entered" from="Hitbox" to="." method="_on_Hitbox_body_shape_entered"]
game/map_decorations/teleport.scn +0 -0
(no content changes — binary or rename)
game/map_decorations/teleporter.gd +4 -1
……@@ -50,7 +50,10 @@ func _on_CollisionShape_gameplay_entered():
5050func _on_Hitbox_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
5151 if(body is KinematicBody):
5252 tryMapChange(teleportation_destination, true, body)
53 print("blah")
54
5355
5456
5557func _on_Hitbox_body_entered(body):
56 pass # Replace with function body.
58 if(body is KinematicBody):
59 tryMapChange(teleportation_destination, true, body)
game/maps/map_cyber/map_cyber.tscn +0 -1
……@@ -50,7 +50,6 @@ transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 15.6924, -12.4585, 11.85
5050[node name="Teleporter_1" parent="PlayerTeleportNodes" instance=ExtResource( 1 )]
5151transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 15.8994, 2.9665, -56.0907 )
5252script = ExtResource( 7 )
53teleportation_destination = "map_test"
5453
5554[node name="Teleporter" parent="PlayerTeleportNodes" instance=ExtResource( 5 )]
5655transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 16.031, -1.21, 38.792 )
game/maps/map_test/map_test.tscn +6 -3
……@@ -32,9 +32,6 @@ max_distance = 500.0
3232[node name="Teleporter_1" parent="Teleporters" instance=ExtResource( 4 )]
3333transform = Transform( 0.655427, 0, -0.755259, 0, 1, 0, 0.755259, 0, 0.655427, -15.0371, -3.75616, -37.6492 )
3434
35[node name="Teleporter" parent="Teleporters" instance=ExtResource( 7 )]
36transform = Transform( 0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -2.36777, 1.11981, -39.4728 )
37
3835[node name="PlayerSpawnNodes" type="Spatial" parent="."]
3936
4037[node name="Spawnpad_1" parent="PlayerSpawnNodes" instance=ExtResource( 3 )]
……@@ -58,4 +55,10 @@ transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -9.88113, 8.96284, -17.1
5855transform = Transform( 30, 0, 0, 0, 30, 0, 0, 0, 80, 0, 0, -23.7039 )
5956shape = SubResource( 35 )
6057
58[node name="Portals" type="Spatial" parent="."]
59
60[node name="Portal" parent="Portals" instance=ExtResource( 7 )]
61transform = Transform( 0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -2.39988, 1.13516, -33.2994 )
62portal_destination = "witchy-world.pck"
63
6164[connection signal="body_entered" from="Area" to="." method="_on_Area_body_entered" binds= [ "map_test" ]]
tumble.jpg.import +35 -0
……@@ -0,0 +1,35 @@
1[remap]
2
3importer="texture"
4type="StreamTexture"
5path="res://.import/tumble.jpg-bde82218c0b4a395c2b9f505281bd2c3.stex"
6metadata={
7"vram_texture": false
8}
9
10[deps]
11
12source_file="res://tumble.jpg"
13dest_files=[ "res://.import/tumble.jpg-bde82218c0b4a395c2b9f505281bd2c3.stex" ]
14
15[params]
16
17compress/mode=0
18compress/lossy_quality=0.7
19compress/hdr_mode=0
20compress/bptc_ldr=0
21compress/normal_map=0
22flags/repeat=0
23flags/filter=true
24flags/mipmaps=false
25flags/anisotropic=false
26flags/srgb=2
27process/fix_alpha_border=true
28process/premult_alpha=false
29process/HDR_as_SRGB=false
30process/invert_color=false
31process/normal_map_invert_y=false
32stream=false
33size_limit=0
34detect_3d=true
35svg/scale=1.0