diff --git a/GrappleZone.gd b/GrappleZone.gd new file mode 100644 index 0000000..5010707 --- /dev/null +++ b/GrappleZone.gd @@ -0,0 +1,14 @@ +extends Area2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func _on_body_entered(body): + if body.has_method("when_stuck"): + body.when_stuck() + +func _on_body_exited(body): + if body.has_method("when_stuck"): + body.stuck = false diff --git a/Hook.gd b/Hook.gd new file mode 100644 index 0000000..253ff52 --- /dev/null +++ b/Hook.gd @@ -0,0 +1,39 @@ +extends RigidBody2D + +var casted : bool = false +var submerged : bool = false +var stuck : bool = false + +const AIR_RESISTANCE = 7.0 +const WATER_RESISTANCE = 90.0 + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + pass + +func _physics_process(_delta): + if stuck && linear_velocity.x != 0: + syncStuck() + if casted && submerged: + when_submerged() + elif casted && !submerged: + linear_velocity.x = move_toward(linear_velocity.x, 0, AIR_RESISTANCE) + +func when_submerged(): + angular_velocity = move_toward(angular_velocity, 0.5, 1.5) + linear_velocity.x = move_toward(linear_velocity.x, 0, WATER_RESISTANCE) + linear_velocity.y = move_toward(linear_velocity.y, 25, WATER_RESISTANCE) + +func when_stuck(): + stuck = true + +@rpc("any_peer", "call_local") +func syncStuck() -> void: + linear_velocity.x = 0 + linear_velocity.y = 0 + angular_velocity = 0 + gravity_scale = 0 diff --git a/Idle (32x32).png b/Idle (32x32).png new file mode 100644 index 0000000..4cbc070 Binary files /dev/null and b/Idle (32x32).png differ diff --git a/Idle (32x32).png.import b/Idle (32x32).png.import new file mode 100644 index 0000000..bcae48b --- /dev/null +++ b/Idle (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpoayxj2o7yos" +path="res://.godot/imported/Idle (32x32).png-eab6f8bc6cc3e2ad30a389b322c823ee.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Idle (32x32).png" +dest_files=["res://.godot/imported/Idle (32x32).png-eab6f8bc6cc3e2ad30a389b322c823ee.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/InvasionGame/Assets/background.png b/InvasionGame/Assets/background.png new file mode 100644 index 0000000..d443513 Binary files /dev/null and b/InvasionGame/Assets/background.png differ diff --git a/InvasionGame/Assets/background.png.import b/InvasionGame/Assets/background.png.import new file mode 100644 index 0000000..4f82f52 --- /dev/null +++ b/InvasionGame/Assets/background.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bg0jm8d1nr1fe" +path="res://.godot/imported/background.png-43d745a6ca23b706381eec07eead4b7d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://InvasionGame/Assets/background.png" +dest_files=["res://.godot/imported/background.png-43d745a6ca23b706381eec07eead4b7d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/InvasionGame/Assets/shadow.png b/InvasionGame/Assets/shadow.png new file mode 100644 index 0000000..61170df Binary files /dev/null and b/InvasionGame/Assets/shadow.png differ diff --git a/InvasionGame/Assets/shadow.png.import b/InvasionGame/Assets/shadow.png.import new file mode 100644 index 0000000..3612ef0 --- /dev/null +++ b/InvasionGame/Assets/shadow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvthcsg02y8e7" +path="res://.godot/imported/shadow.png-f773d23f134ae05fd059bbf548efc1ac.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://InvasionGame/Assets/shadow.png" +dest_files=["res://.godot/imported/shadow.png-f773d23f134ae05fd059bbf548efc1ac.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/InvasionGame/Assets/temp_body.png b/InvasionGame/Assets/temp_body.png new file mode 100644 index 0000000..2757929 Binary files /dev/null and b/InvasionGame/Assets/temp_body.png differ diff --git a/InvasionGame/Assets/temp_body.png.import b/InvasionGame/Assets/temp_body.png.import new file mode 100644 index 0000000..ee72da7 --- /dev/null +++ b/InvasionGame/Assets/temp_body.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7njr7mty1l3m" +path="res://.godot/imported/temp_body.png-b4f7932ffce4889f1260ed17644bb562.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://InvasionGame/Assets/temp_body.png" +dest_files=["res://.godot/imported/temp_body.png-b4f7932ffce4889f1260ed17644bb562.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/InvasionGame/Scenes/gnome.tscn b/InvasionGame/Scenes/gnome.tscn new file mode 100644 index 0000000..f832be1 --- /dev/null +++ b/InvasionGame/Scenes/gnome.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=5 format=3 uid="uid://bdqm21wnq55fr"] + +[ext_resource type="Texture2D" uid="uid://b7njr7mty1l3m" path="res://InvasionGame/Assets/temp_body.png" id="1_8lr4i"] +[ext_resource type="Texture2D" uid="uid://bvthcsg02y8e7" path="res://InvasionGame/Assets/shadow.png" id="1_iewdx"] +[ext_resource type="Script" path="res://InvasionGame/Scripts/gnome.gd" id="1_nr5yv"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_00gno"] +size = Vector2(60, 80) + +[node name="Gnome" type="CharacterBody2D"] +script = ExtResource("1_nr5yv") + +[node name="ShadowSprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_iewdx") + +[node name="GnomeSprite2D" type="Sprite2D" parent="."] +position = Vector2(0, -40) +texture = ExtResource("1_8lr4i") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -40) +shape = SubResource("RectangleShape2D_00gno") + +[node name="Camera2D" type="Camera2D" parent="."] +zoom = Vector2(0.59, 0.59) diff --git a/InvasionGame/Scenes/invasion_world.tscn b/InvasionGame/Scenes/invasion_world.tscn new file mode 100644 index 0000000..a75952b --- /dev/null +++ b/InvasionGame/Scenes/invasion_world.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=2 format=3 uid="uid://dltuaf2shbn46"] + +[ext_resource type="Texture2D" uid="uid://bg0jm8d1nr1fe" path="res://InvasionGame/Assets/background.png" id="1_ss0j8"] + +[node name="World" type="Node2D"] + +[node name="Background" type="Sprite2D" parent="."] +modulate = Color(0.446777, 0.446777, 0.446777, 1) +texture = ExtResource("1_ss0j8") + +[node name="Players" type="Node2D" parent="."] + +[node name="SpawnPoint" type="Node2D" parent="."] + +[node name="PlayerSpawner" type="MultiplayerSpawner" parent="."] +_spawnable_scenes = PackedStringArray("res://InvasionGame/Scenes/gnome.tscn") +spawn_path = NodePath("../Players") diff --git a/InvasionGame/Scripts/gnome.gd b/InvasionGame/Scripts/gnome.gd new file mode 100644 index 0000000..a966e51 --- /dev/null +++ b/InvasionGame/Scripts/gnome.gd @@ -0,0 +1,39 @@ +extends CharacterBody2D + + +const SPEED = 300.0 +const JUMP_VELOCITY = -400.0 + +# Get the gravity from the project settings to be synced with RigidBody nodes. +var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") + +@rpc("any_peer", "call_local") +func set_authority(id : int) -> void: + set_multiplayer_authority(id) + +func _physics_process(delta): + # Add the gravity. + #if not is_on_floor(): + #velocity.y += gravity * delta + + # Handle jump. + if Input.is_action_just_pressed("ui_accept") and is_on_floor(): + velocity.y = JUMP_VELOCITY + + # Get the input direction and handle the movement/deceleration. + # As good practice, you should replace UI actions with custom gameplay actions. + var direction = Input.get_axis("ui_left", "ui_right") + if direction: + velocity.x = direction * SPEED + else: + velocity.x = move_toward(velocity.x, 0, SPEED) + + move_and_slide() + +func set_player_name(value : String): + #$label.text = value + return + +@rpc("any_peer", "call_local") +func teleport(new_position : Vector2) -> void: + self.position = new_position diff --git a/Killzone.gd b/Killzone.gd new file mode 100644 index 0000000..cf2ff31 --- /dev/null +++ b/Killzone.gd @@ -0,0 +1,15 @@ +extends Area2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + set_collision_mask_value(2, true) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + pass + +func _on_body_entered(body): + body.position.x = 565 + body.position.y = 475 diff --git a/OneWayPlats.gd b/OneWayPlats.gd new file mode 100644 index 0000000..f505253 --- /dev/null +++ b/OneWayPlats.gd @@ -0,0 +1,16 @@ +extends Area2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + set_collision_mask_value(2, true) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + pass + +func _on_body_entered(body): + body.canFall = true + +func _on_body_exited(body): + body.canFall = false diff --git a/WaterArea2D.gd b/WaterArea2D.gd new file mode 100644 index 0000000..d63ea42 --- /dev/null +++ b/WaterArea2D.gd @@ -0,0 +1,20 @@ +extends Area2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + pass + +func _on_body_entered(body): + if body.has_method("when_submerged"): + body.submerged = true + body.linear_velocity.y *= 0.9 + +func _on_body_exited(body): + if body.has_method("when_submerged"): + body.submerged = false diff --git a/addons/godotsteam/win64/~godotsteam.debug.x86_64.dll~RF5774a71.TMP b/addons/godotsteam/win64/~godotsteam.debug.x86_64.dll~RF5774a71.TMP new file mode 100644 index 0000000..0cd7393 Binary files /dev/null and b/addons/godotsteam/win64/~godotsteam.debug.x86_64.dll~RF5774a71.TMP differ diff --git a/addons/godotsteam/win64/~godotsteam.debug.x86_64.dll~RFa60b687.TMP b/addons/godotsteam/win64/~godotsteam.debug.x86_64.dll~RFa60b687.TMP new file mode 100644 index 0000000..0cd7393 Binary files /dev/null and b/addons/godotsteam/win64/~godotsteam.debug.x86_64.dll~RFa60b687.TMP differ diff --git a/addons/steam-multiplayer-peer/win64/~steam-multiplayer-peer.windows.template_debug.x86_64.dll~RF5774adf.TMP b/addons/steam-multiplayer-peer/win64/~steam-multiplayer-peer.windows.template_debug.x86_64.dll~RF5774adf.TMP new file mode 100644 index 0000000..7370d1e Binary files /dev/null and b/addons/steam-multiplayer-peer/win64/~steam-multiplayer-peer.windows.template_debug.x86_64.dll~RF5774adf.TMP differ diff --git a/addons/steam-multiplayer-peer/win64/~steam-multiplayer-peer.windows.template_debug.x86_64.dll~RFa60b6e5.TMP b/addons/steam-multiplayer-peer/win64/~steam-multiplayer-peer.windows.template_debug.x86_64.dll~RFa60b6e5.TMP new file mode 100644 index 0000000..7370d1e Binary files /dev/null and b/addons/steam-multiplayer-peer/win64/~steam-multiplayer-peer.windows.template_debug.x86_64.dll~RFa60b6e5.TMP differ diff --git a/fisher.gd b/fisher.gd new file mode 100644 index 0000000..95f16a0 --- /dev/null +++ b/fisher.gd @@ -0,0 +1,106 @@ +extends CharacterBody2D + +@onready var anim_player = $anim_player +@onready var sprite = $sprite +@onready var hand = $Hand + +@export var health : float + +const SPEED = 140.0 +const AIRSPEED = 15.0 +const JUMP_VELOCITY = -210.0 +const FRICTION = 20.0 + +# Get the gravity from the project settings to be synced with RigidBody nodes. +var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") +var casted : bool = false +var facingLeft = false +var canFall = false +var momentum = 0 +var airJumps = 1 + +#func _enter_tree(): + #set_multiplayer_authority(str(name).to_int()) + + #camera.current = true + +@rpc("any_peer", "call_local") +func set_authority(id : int) -> void: + set_multiplayer_authority(id) + +func _physics_process(delta): + if is_multiplayer_authority(): + set_collision_mask_value(2, true) + set_collision_mask_value(3, true) + set_collision_mask_value(4, true) + + anim_player.play("idle") + + # Add the gravity. + if not is_on_floor(): + velocity.y += gravity * delta + if Input.is_action_just_pressed("jump") and airJumps > 0: + velocity.y = JUMP_VELOCITY + airJumps -= airJumps + if !Input.get_axis("left", "right"): + velocity.x = 0 + if Input.is_action_pressed("down"): + set_collision_mask_value(2, false) + set_collision_mask_value(3, false) + set_collision_mask_value(4, false) + + if is_on_floor(): + if Input.is_action_just_pressed("jump"): + velocity.y = JUMP_VELOCITY + if Input.is_action_pressed("down"): + set_collision_mask_value(2, false) + set_collision_mask_value(3, false) + set_collision_mask_value(4, false) + + #var input_direction = Input.get_vector("left", "right", "up", "down") + var input_direction = Input.get_axis("left", "right") + + #if input_direction and controlling: + if is_on_floor(): + if airJumps == 0: + airJumps = 1 + if momentum != 0 && abs(momentum) > abs(SPEED): + if velocity.x * input_direction < 0: + momentum += input_direction * AIRSPEED + velocity.x = momentum + else: + velocity.x = momentum + else: + velocity.x = input_direction * SPEED + + momentum = move_toward(momentum, 0, FRICTION) + + ###################################### + #flips sprite when changing directions + ###################################### + if ((velocity.x < 0 && facingLeft == false) || (velocity.x > 0 && facingLeft == true)) && !casted: + hand.scale.x *= -1 + sprite.scale.x *= -1 + facingLeft = !facingLeft + + if !is_on_floor(): + #momentum += input_direction * AIRSPEED * delta + if abs(velocity.x) > abs(SPEED): + if velocity.x * input_direction < 0: + velocity.x += input_direction * AIRSPEED + else: + velocity.x += input_direction * AIRSPEED + #velocity.x = input_direction * SPEED + momentum = velocity.x + move_and_slide() + +func set_player_name(value : String): + $label.text = value + +func _is_facing_left(): + if facingLeft: + return true + +@rpc("any_peer", "call_local") +func teleport(new_position : Vector2) -> void: + self.position = new_position diff --git a/fisher.tscn b/fisher.tscn new file mode 100644 index 0000000..89618f5 --- /dev/null +++ b/fisher.tscn @@ -0,0 +1,101 @@ +[gd_scene load_steps=10 format=3 uid="uid://dl7oxoy6aw45r"] + +[ext_resource type="Script" path="res://fisher.gd" id="1_gfxeq"] +[ext_resource type="Texture2D" uid="uid://dpoayxj2o7yos" path="res://Idle (32x32).png" id="2_y7smo"] +[ext_resource type="PackedScene" uid="uid://4idxncek7lq4" path="res://rod.tscn" id="3_vrd4b"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_gvv2b"] +size = Vector2(23, 24) + +[sub_resource type="Animation" id="Animation_eb6go"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + +[sub_resource type="Animation" id="Animation_6qgn8"] +resource_name = "idle" +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_ofwxc"] +_data = { +"RESET": SubResource("Animation_eb6go"), +"idle": SubResource("Animation_6qgn8") +} + +[sub_resource type="LabelSettings" id="LabelSettings_rdm0c"] + +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_cshev"] +properties/0/path = NodePath(".:position") +properties/0/spawn = true +properties/0/replication_mode = 1 +properties/1/path = NodePath("sprite:scale") +properties/1/spawn = true +properties/1/replication_mode = 2 +properties/2/path = NodePath("label:text") +properties/2/spawn = true +properties/2/replication_mode = 2 + +[node name="fisher" type="CharacterBody2D"] +collision_layer = 2 +collision_mask = 3 +script = ExtResource("1_gfxeq") + +[node name="sprite" type="Sprite2D" parent="."] +texture_filter = 1 +position = Vector2(0, -16) +texture = ExtResource("2_y7smo") +hframes = 11 + +[node name="shape" type="CollisionShape2D" parent="."] +position = Vector2(-0.5, -12) +shape = SubResource("RectangleShape2D_gvv2b") +one_way_collision = true + +[node name="Hand" type="Node2D" parent="."] + +[node name="Rod" parent="Hand" instance=ExtResource("3_vrd4b")] +z_index = 1 +position = Vector2(10.9524, -7.61905) + +[node name="anim_player" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_ofwxc") +} + +[node name="label" type="Label" parent="."] +offset_left = -44.7619 +offset_top = -37.1429 +offset_right = 135.238 +offset_bottom = -14.1429 +scale = Vector2(0.5, 0.5) +size_flags_horizontal = 2 +size_flags_vertical = 0 +text = "Me" +label_settings = SubResource("LabelSettings_rdm0c") +horizontal_alignment = 1 +autowrap_mode = 2 + +[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] +replication_config = SubResource("SceneReplicationConfig_cshev") diff --git a/fishingHook.png b/fishingHook.png new file mode 100644 index 0000000..fa4bc39 Binary files /dev/null and b/fishingHook.png differ diff --git a/fishingHook.png.import b/fishingHook.png.import new file mode 100644 index 0000000..f90925d --- /dev/null +++ b/fishingHook.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cqtntpvba1c7v" +path="res://.godot/imported/fishingHook.png-ad49c963e6d58280a6061c7c7257c228.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://fishingHook.png" +dest_files=["res://.godot/imported/fishingHook.png-ad49c963e6d58280a6061c7c7257c228.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/fishingHookSmall.png b/fishingHookSmall.png new file mode 100644 index 0000000..62f7161 Binary files /dev/null and b/fishingHookSmall.png differ diff --git a/fishingHookSmall.png.import b/fishingHookSmall.png.import new file mode 100644 index 0000000..ca3cfa1 --- /dev/null +++ b/fishingHookSmall.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dk86c6xo84mcg" +path="res://.godot/imported/fishingHookSmall.png-10ab8522ec7cc70817583693e729d82d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://fishingHookSmall.png" +dest_files=["res://.godot/imported/fishingHookSmall.png-10ab8522ec7cc70817583693e729d82d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/fishingRod.png b/fishingRod.png new file mode 100644 index 0000000..a53eaf5 Binary files /dev/null and b/fishingRod.png differ diff --git a/fishingRod.png.import b/fishingRod.png.import new file mode 100644 index 0000000..0315d30 --- /dev/null +++ b/fishingRod.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxpjdejn671to" +path="res://.godot/imported/fishingRod.png-37f69fe621f7f5dd2d51b00c996df4c1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://fishingRod.png" +dest_files=["res://.godot/imported/fishingRod.png-37f69fe621f7f5dd2d51b00c996df4c1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/fishingRodSmall.png b/fishingRodSmall.png new file mode 100644 index 0000000..0f8921a Binary files /dev/null and b/fishingRodSmall.png differ diff --git a/fishingRodSmall.png.import b/fishingRodSmall.png.import new file mode 100644 index 0000000..b55d78c --- /dev/null +++ b/fishingRodSmall.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dv3toxgrkel08" +path="res://.godot/imported/fishingRodSmall.png-2a63ebdb8b0436d377c1721cf1c538b2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://fishingRodSmall.png" +dest_files=["res://.godot/imported/fishingRodSmall.png-2a63ebdb8b0436d377c1721cf1c538b2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/gamestate.gd b/gamestate.gd index ed94807..4b94cc5 100644 --- a/gamestate.gd +++ b/gamestate.gd @@ -106,7 +106,7 @@ func _ready(): if status == 1: #lobby_id = new_lobby_id Steam.setLobbyData(new_lobby_id, "name", - str(Steam.getPersonaName(), "'s Spectabulous Test Server")) + str(Steam.getPersonaName(), "'s Fishy Test Server")) create_steam_socket() else: game_error.emit("Error on create lobby!") @@ -131,7 +131,7 @@ func unregister_player(id): @rpc("call_local") func load_world(): # Change scene. - var world = load("res://world.tscn").instantiate() + var world = load("res://InvasionGame/Scenes/invasion_world.tscn").instantiate() get_tree().get_root().add_child(world) get_tree().get_root().get_node("Lobby").hide() @@ -161,10 +161,10 @@ func begin_game(): #grab the world node and player scene var world : Node2D = get_tree().get_root().get_node("World") - var player_scene := load("res://new_player.tscn") + var player_scene := load("res://InvasionGame/Scenes/gnome.tscn") - #Iterate over our connected peer ids - var spawn_index = 0 + #Iterate over our connected peer ids, i commented this out + #var spawn_index = 0 for peer_id in players: print("PEER ID: ", peer_id) @@ -178,14 +178,16 @@ func begin_game(): #Set the authorization for the player. This has to be called on all peers to stay in sync. player.set_authority.rpc(peer_id) - #Grab our location for the player. - var target : Vector2 = world.get_node("SpawnPoints").get_child(spawn_index).position + #Grab our location for the player. i commented this out + #var target : Vector2 = world.get_node("SpawnPoint").get_child(spawn_index).position + var target : Vector2 = world.get_node("SpawnPoint").position #The peer has authority over the player's position, so to sync it properly, #we need to set that position from that peer with an RPC. player.teleport.rpc_id(peer_id, target) - spawn_index += 1 + #i commented this out + #spawn_index += 1 # create_steam_socket and connect_steam_socket both create the multiplayer peer, instead # of _ready, for the sake of compatibility with other networking services diff --git a/new_player.tscn b/new_player.tscn index 989555e..d640e7e 100644 --- a/new_player.tscn +++ b/new_player.tscn @@ -211,7 +211,7 @@ animation = &"standing" [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_1vppo"] [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_iy7lw"] -graph_offset = Vector2(-261.903, 174.127) +graph_offset = Vector2(-704.934, 197.168) nodes/Animation/node = SubResource("AnimationNodeAnimation_rwggn") nodes/Animation/position = Vector2(-240, 260) "nodes/Animation 2/node" = SubResource("AnimationNodeAnimation_me1ep") @@ -270,9 +270,6 @@ libraries = { } [node name="AnimationTree" type="AnimationTree" parent="." node_paths=PackedStringArray("player")] -libraries = { -"": SubResource("AnimationLibrary_o1yrk") -} tree_root = SubResource("AnimationNodeBlendTree_iy7lw") anim_player = NodePath("../AnimationPlayer") parameters/down/blend_amount = 0 diff --git a/not_solid_water.png b/not_solid_water.png new file mode 100644 index 0000000..3baed4d Binary files /dev/null and b/not_solid_water.png differ diff --git a/not_solid_water.png.import b/not_solid_water.png.import new file mode 100644 index 0000000..bec64ce --- /dev/null +++ b/not_solid_water.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://xn32fyqu3ncd" +path="res://.godot/imported/not_solid_water.png-2afe1eb12068195d0d4e6d14c7394730.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://not_solid_water.png" +dest_files=["res://.godot/imported/not_solid_water.png-2afe1eb12068195d0d4e6d14c7394730.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/project.godot b/project.godot index ad4bc67..ab1e613 100644 --- a/project.godot +++ b/project.godot @@ -10,7 +10,7 @@ config_version=5 [application] -config/name="Multiplayer Bomber" +config/name="Invasion Game" config/description="A multiplayer implementation of the classical bomberman game. One of the players should press 'host', while the other should type in his address and press 'play'." @@ -62,14 +62,45 @@ move_up={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) ] } -set_bomb={ +jump={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null) ] } +left={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null) +] +} +right={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null) +] +} +down={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null) +] +} +fire={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(163, 13),"global_position":Vector2(167, 54),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} +m2={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(102, 22),"global_position":Vector2(106, 63),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} +debug={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":66,"key_label":0,"unicode":98,"echo":false,"script":null) +] +} + +[physics] + +2d/default_gravity=900.0 [replication] diff --git a/raft.png b/raft.png new file mode 100644 index 0000000..a406729 Binary files /dev/null and b/raft.png differ diff --git a/raft.png.import b/raft.png.import new file mode 100644 index 0000000..a57c6ea --- /dev/null +++ b/raft.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b60ayt7fmmqmk" +path="res://.godot/imported/raft.png-6ee4b020777bf0e90c9d5b07a50c04a5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://raft.png" +dest_files=["res://.godot/imported/raft.png-6ee4b020777bf0e90c9d5b07a50c04a5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/rod.gd b/rod.gd new file mode 100644 index 0000000..f141d3e --- /dev/null +++ b/rod.gd @@ -0,0 +1,83 @@ +extends Node2D + +@onready var trajectoryLine = $TrajectoryLine +@onready var line = $Line +@onready var hook = $Hook +@onready var fakeHook = $FakeHook + +var fisher : Node2D +var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") +var chargeTimer = 0 +var spawnBuffer = 0.5 +var fireAngle = Vector2.ZERO + +var casting = false +var casted = false + +const AIR_RESISTANCE = 7.0 + +# Called when the node enters the scene tree for the first time. +func _ready(): + hook.hide() + line.hide() + if get_parent().get_parent(): + fisher = get_parent().get_parent() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if is_multiplayer_authority(): + if spawnBuffer > 0: + spawnBuffer -= delta + return + if Input.is_action_just_pressed("fire"): + fisher.casted = false + casting = true + casted = false + trajectoryLine.show() + hook.hide() + line.hide() + if Input.is_action_just_released("fire") && casting: + fisher.casted = true + casting = false + casted = true + trajectoryLine.clear_points() + trajectoryLine.hide() + fakeHook.hide() + hook.stuck = false + hook.gravity_scale = 1 + hook.global_position.x = trajectoryLine.global_position.x + hook.global_position.y = trajectoryLine.global_position.y + hook.linear_velocity = Vector2.ZERO + if fisher != null && fisher.has_method("_is_facing_left"): + if fisher._is_facing_left(): + fireAngle.x *= -1 + hook.apply_impulse(fireAngle * chargeTimer, Vector2.ZERO) + hook.show() + chargeTimer = 0 + +func _physics_process(delta): + if is_multiplayer_authority(): + if casting: + chargeTimer = clamp(chargeTimer + delta, 0, 1.6) + fireAngle = Vector2(-300,0).rotated(trajectoryLine.get_angle_to(get_global_mouse_position())) + update_trajectory(fireAngle, chargeTimer, delta) + if casted: + line.show() + update_line() + hook.casted = true + #hook.linear_velocity.x = move_toward(hook.linear_velocity.x, 0, AIR_RESISTANCE) + +func update_trajectory(dir: Vector2, timeCharged: float, delta: float): + var max_points = 50 + trajectoryLine.clear_points() + var pos: Vector2 = Vector2.ZERO + var vel = dir * timeCharged + for i in max_points: + trajectoryLine.add_point(pos) + vel.x = move_toward(vel.x, 0, AIR_RESISTANCE) + vel.y += gravity * delta + pos += vel * delta + +func update_line(): + line.points[1].x = hook.position.x + line.points[1].y = hook.position.y diff --git a/rod.tscn b/rod.tscn new file mode 100644 index 0000000..006668f --- /dev/null +++ b/rod.tscn @@ -0,0 +1,100 @@ +[gd_scene load_steps=8 format=3 uid="uid://4idxncek7lq4"] + +[ext_resource type="Script" path="res://rod.gd" id="1_l30kt"] +[ext_resource type="Texture2D" uid="uid://dv3toxgrkel08" path="res://fishingRodSmall.png" id="2_p4swk"] +[ext_resource type="Script" path="res://Hook.gd" id="3_de3k4"] +[ext_resource type="Texture2D" uid="uid://dk86c6xo84mcg" path="res://fishingHookSmall.png" id="3_e8rq1"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_3tp1x"] +radius = 9.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_nbep4"] +radius = 3.0 + +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_jup4p"] +properties/0/path = NodePath("Hook:angular_velocity") +properties/0/spawn = true +properties/0/replication_mode = 1 +properties/1/path = NodePath("Hook:position") +properties/1/spawn = true +properties/1/replication_mode = 1 +properties/2/path = NodePath("Hook:visible") +properties/2/spawn = true +properties/2/replication_mode = 2 +properties/3/path = NodePath("FakeHook:visible") +properties/3/spawn = true +properties/3/replication_mode = 2 +properties/4/path = NodePath("Hook:linear_velocity") +properties/4/spawn = true +properties/4/replication_mode = 1 + +[node name="Rod" type="Node2D"] +script = ExtResource("1_l30kt") + +[node name="RodSprite" type="Sprite2D" parent="."] +texture_filter = 1 +position = Vector2(4, -15) +texture = ExtResource("2_p4swk") + +[node name="TrajectoryLine" type="Line2D" parent="."] +position = Vector2(8, -39) +width = 3.0 + +[node name="Line" type="Line2D" parent="."] +visible = false +points = PackedVector2Array(8, -39, 0, 0) +width = 1.0 +default_color = Color(0.230315, 0.230315, 0.230315, 1) + +[node name="Hook" type="RigidBody2D" parent="."] +visible = false +position = Vector2(8, -40) +collision_layer = 4 +collision_mask = 0 +script = ExtResource("3_de3k4") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hook"] +position = Vector2(0, 1) +scale = Vector2(0.46858, 0.46858) +shape = SubResource("CircleShape2D_3tp1x") + +[node name="HookSprite" type="Sprite2D" parent="Hook"] +texture_filter = 1 +position = Vector2(0, 1) +texture = ExtResource("3_e8rq1") + +[node name="StaticBody2D" type="StaticBody2D" parent="."] +visible = false +position = Vector2(8, -39) +collision_layer = 0 +collision_mask = 0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] +shape = SubResource("CircleShape2D_nbep4") + +[node name="FakeHook" type="RigidBody2D" parent="."] +position = Vector2(8, -34) +collision_layer = 0 +collision_mask = 0 +mass = 0.02 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="FakeHook"] +scale = Vector2(0.46858, 0.46858) +shape = SubResource("CircleShape2D_3tp1x") + +[node name="HookSprite" type="Sprite2D" parent="FakeHook"] +texture_filter = 1 +texture = ExtResource("3_e8rq1") + +[node name="Pinjoint" type="PinJoint2D" parent="."] +visible = false +position = Vector2(8, -36) +node_a = NodePath("../StaticBody2D") +node_b = NodePath("../FakeHook") +bias = 0.9 + +[node name="Camera2D" type="Camera2D" parent="."] +zoom = Vector2(5.32, 5.32) + +[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] +replication_config = SubResource("SceneReplicationConfig_jup4p") diff --git a/solid_water.png b/solid_water.png new file mode 100644 index 0000000..e6eab89 Binary files /dev/null and b/solid_water.png differ diff --git a/solid_water.png.import b/solid_water.png.import new file mode 100644 index 0000000..532598d --- /dev/null +++ b/solid_water.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bt4drjhft066w" +path="res://.godot/imported/solid_water.png-25508d8d3299bc04495ed65f4f882efa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://solid_water.png" +dest_files=["res://.godot/imported/solid_water.png-25508d8d3299bc04495ed65f4f882efa.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/world2.tscn b/world2.tscn new file mode 100644 index 0000000..7e912a8 --- /dev/null +++ b/world2.tscn @@ -0,0 +1,111 @@ +[gd_scene load_steps=12 format=3 uid="uid://d3546qds5gcfb"] + +[ext_resource type="Texture2D" uid="uid://bt4drjhft066w" path="res://solid_water.png" id="1_w012b"] +[ext_resource type="Texture2D" uid="uid://b60ayt7fmmqmk" path="res://raft.png" id="2_xwhuj"] +[ext_resource type="Script" path="res://GrappleZone.gd" id="3_lkd0l"] +[ext_resource type="Texture2D" uid="uid://xn32fyqu3ncd" path="res://not_solid_water.png" id="3_wndad"] +[ext_resource type="Script" path="res://Killzone.gd" id="5_ig7f3"] +[ext_resource type="Script" path="res://WaterArea2D.gd" id="6_150ln"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_alrf4"] +size = Vector2(455.085, 66.9492) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_xp0nj"] +size = Vector2(503, 20) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_8vxli"] +size = Vector2(503, 6) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cs2bk"] +size = Vector2(3532, 314) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_x0lj3"] +size = Vector2(1374, 380) + +[node name="World" type="Node2D"] + +[node name="Water Background" type="Sprite2D" parent="."] +position = Vector2(570, 424) +scale = Vector2(2.51, 1) +texture = ExtResource("1_w012b") + +[node name="Raft" type="Node2D" parent="."] +position = Vector2(558, 403) +scale = Vector2(0.5, 0.5) + +[node name="Sprite2D" type="Sprite2D" parent="Raft"] +scale = Vector2(1.18, 1.18) +texture = ExtResource("2_xwhuj") + +[node name="RaftBase" type="StaticBody2D" parent="Raft"] +scale = Vector2(1.18, 1.18) +collision_mask = 0 + +[node name="Base" type="CollisionShape2D" parent="Raft/RaftBase"] +position = Vector2(1.27118, 191.102) +shape = SubResource("RectangleShape2D_alrf4") + +[node name="Mast Lower Bar" type="StaticBody2D" parent="Raft"] +position = Vector2(8, 63) +collision_layer = 0 +collision_mask = 0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Raft/Mast Lower Bar"] +shape = SubResource("RectangleShape2D_xp0nj") +one_way_collision = true + +[node name="Area2D" type="Area2D" parent="Raft/Mast Lower Bar"] +collision_layer = 0 +collision_mask = 4 +script = ExtResource("3_lkd0l") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Raft/Mast Lower Bar/Area2D"] +shape = SubResource("RectangleShape2D_8vxli") + +[node name="Players" type="Node2D" parent="."] + +[node name="Killzone" type="Area2D" parent="."] +visible = false +collision_layer = 0 +collision_mask = 2 +script = ExtResource("5_ig7f3") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Killzone"] +position = Vector2(565, 899) +shape = SubResource("RectangleShape2D_cs2bk") + +[node name="Water Foreground" type="Sprite2D" parent="."] +position = Vector2(551, 424) +scale = Vector2(2.605, 1) +texture = ExtResource("3_wndad") + +[node name="WaterArea2D" type="Area2D" parent="."] +position = Vector2(572, 591) +collision_layer = 0 +collision_mask = 4 +gravity_point_center = Vector2(0, -1) +gravity_direction = Vector2(0, -1) +gravity = 10.0 +linear_damp = 99.92 +script = ExtResource("6_150ln") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="WaterArea2D"] +position = Vector2(0, 110) +shape = SubResource("RectangleShape2D_x0lj3") + +[node name="SpawnPoint" type="Node2D" parent="."] +position = Vector2(566, 449) + +[node name="Camera2D" type="Camera2D" parent="."] +position = Vector2(562, 404) +zoom = Vector2(1.685, 1.685) + +[node name="PlayerSpawner" type="MultiplayerSpawner" parent="."] +_spawnable_scenes = PackedStringArray("res://fisher.tscn") +spawn_path = NodePath("../Players") + +[connection signal="body_entered" from="Raft/Mast Lower Bar/Area2D" to="Raft/Mast Lower Bar/Area2D" method="_on_body_entered"] +[connection signal="body_exited" from="Raft/Mast Lower Bar/Area2D" to="Raft/Mast Lower Bar/Area2D" method="_on_body_exited"] +[connection signal="body_entered" from="Killzone" to="Killzone" method="_on_body_entered"] +[connection signal="body_entered" from="WaterArea2D" to="WaterArea2D" method="_on_body_entered"] +[connection signal="body_exited" from="WaterArea2D" to="WaterArea2D" method="_on_body_exited"] diff --git a/world3.tscn b/world3.tscn new file mode 100644 index 0000000..eb3a24b --- /dev/null +++ b/world3.tscn @@ -0,0 +1,92 @@ +[gd_scene load_steps=11 format=3 uid="uid://dx45ppvkp74f3"] + +[ext_resource type="Texture2D" uid="uid://bt4drjhft066w" path="res://solid_water.png" id="1_78muj"] +[ext_resource type="Texture2D" uid="uid://b60ayt7fmmqmk" path="res://raft.png" id="2_r44pj"] +[ext_resource type="Script" path="res://OneWayPlats.gd" id="3_o5jrv"] +[ext_resource type="PackedScene" uid="uid://dl7oxoy6aw45r" path="res://fisher.tscn" id="4_5xv76"] +[ext_resource type="Script" path="res://Killzone.gd" id="4_xmh73"] +[ext_resource type="Texture2D" uid="uid://xn32fyqu3ncd" path="res://not_solid_water.png" id="5_71eb0"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_alrf4"] +size = Vector2(455.085, 66.9492) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_xp0nj"] +size = Vector2(503, 20) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_8vxli"] +size = Vector2(503, 20) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cs2bk"] +size = Vector2(3532, 314) + +[node name="World" type="Node2D"] + +[node name="Water Background" type="Sprite2D" parent="."] +position = Vector2(570, 424) +scale = Vector2(2.51, 1) +texture = ExtResource("1_78muj") + +[node name="Raft" type="Node2D" parent="."] + +[node name="Sprite2D" type="Sprite2D" parent="Raft"] +position = Vector2(558, 300) +scale = Vector2(1.18, 1.18) +texture = ExtResource("2_r44pj") + +[node name="Base" type="StaticBody2D" parent="Raft"] +position = Vector2(558, 300) +scale = Vector2(1.18, 1.18) +collision_mask = 0 + +[node name="Base" type="CollisionShape2D" parent="Raft/Base"] +position = Vector2(1.27118, 191.102) +shape = SubResource("RectangleShape2D_alrf4") + +[node name="Mast Lower Bar" type="StaticBody2D" parent="Raft"] +position = Vector2(567, 360) +collision_layer = 4 +collision_mask = 0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Raft/Mast Lower Bar"] +position = Vector2(-1.5, 2) +shape = SubResource("RectangleShape2D_xp0nj") +one_way_collision = true + +[node name="Area2D" type="Area2D" parent="Raft/Mast Lower Bar"] +collision_layer = 0 +collision_mask = 2 +script = ExtResource("3_o5jrv") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Raft/Mast Lower Bar/Area2D"] +position = Vector2(-1.5, 1) +shape = SubResource("RectangleShape2D_8vxli") + +[node name="Players" type="Node2D" parent="."] + +[node name="fisher" parent="Players" instance=ExtResource("4_5xv76")] +position = Vector2(561, 462) + +[node name="Killzone" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 2 +script = ExtResource("4_xmh73") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Killzone"] +position = Vector2(565, 899) +shape = SubResource("RectangleShape2D_cs2bk") + +[node name="Water Foreground" type="Sprite2D" parent="."] +position = Vector2(551, 424) +scale = Vector2(2.605, 1) +texture = ExtResource("5_71eb0") + +[node name="SpawnPoint" type="Node2D" parent="."] +position = Vector2(566, 449) + +[node name="PlayerSpawner" type="MultiplayerSpawner" parent="."] +_spawnable_scenes = PackedStringArray("res://fisher.tscn") +spawn_path = NodePath("../Players") + +[connection signal="body_entered" from="Raft/Mast Lower Bar/Area2D" to="Raft/Mast Lower Bar/Area2D" method="_on_body_entered"] +[connection signal="body_exited" from="Raft/Mast Lower Bar/Area2D" to="Raft/Mast Lower Bar/Area2D" method="_on_body_exited"] +[connection signal="body_entered" from="Killzone" to="Killzone" method="_on_body_entered"]