diff --git a/.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.md5 b/.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.md5 new file mode 100644 index 0000000..bb2268f --- /dev/null +++ b/.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.md5 @@ -0,0 +1,3 @@ +source_md5="eb66c7dc1b1b58b9d321ef9992599487" +dest_md5="7585c160f835f8ed32d4da170bb25f00" + diff --git a/.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.sample b/.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.sample new file mode 100644 index 0000000..469cabc Binary files /dev/null and b/.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.sample differ diff --git a/.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.md5 b/.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.md5 new file mode 100644 index 0000000..543e5e0 --- /dev/null +++ b/.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.md5 @@ -0,0 +1,3 @@ +source_md5="af14246f1f6727f6d97d0b4d37b02cd3" +dest_md5="f9d270becba640198df2bb641f47717e" + diff --git a/.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.sample b/.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.sample new file mode 100644 index 0000000..a31527d Binary files /dev/null and b/.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.sample differ diff --git a/.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.md5 b/.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.md5 new file mode 100644 index 0000000..82eca9b --- /dev/null +++ b/.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.md5 @@ -0,0 +1,3 @@ +source_md5="63ab22c25c84669b84f04c8e4dcb233a" +dest_md5="1bad5e8481ddc30458968b46329f5d64" + diff --git a/.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.sample b/.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.sample new file mode 100644 index 0000000..67e38b1 Binary files /dev/null and b/.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.sample differ diff --git a/.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.md5 b/.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.md5 new file mode 100644 index 0000000..5eb8933 --- /dev/null +++ b/.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.md5 @@ -0,0 +1,3 @@ +source_md5="a8bc67e62863d07970d7c7b83bfd2aa7" +dest_md5="a42e2c843b7561fd10a134e214e86b43" + diff --git a/.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.stex b/.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.stex new file mode 100644 index 0000000..8881b1f Binary files /dev/null and b/.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.stex differ diff --git a/.import/chain.png-40a65e105e3052733dfec7f73e6a2028.md5 b/.import/chain.png-40a65e105e3052733dfec7f73e6a2028.md5 new file mode 100644 index 0000000..4bf161b --- /dev/null +++ b/.import/chain.png-40a65e105e3052733dfec7f73e6a2028.md5 @@ -0,0 +1,3 @@ +source_md5="30ddc8a2bbe9c142d0d0088f2f0e860a" +dest_md5="686ea14ffb721fe4a377231a2153d3ea" + diff --git a/.import/chain.png-40a65e105e3052733dfec7f73e6a2028.stex b/.import/chain.png-40a65e105e3052733dfec7f73e6a2028.stex new file mode 100644 index 0000000..70f3c5c Binary files /dev/null and b/.import/chain.png-40a65e105e3052733dfec7f73e6a2028.stex differ diff --git a/.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.md5 b/.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.md5 new file mode 100644 index 0000000..809efde --- /dev/null +++ b/.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.md5 @@ -0,0 +1,3 @@ +source_md5="16fc68b438315c3f73728141f45dab4b" +dest_md5="e5c2aeb101a5429e30db4e1e46f295c1" + diff --git a/.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.stex b/.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.stex new file mode 100644 index 0000000..4b0f9c7 Binary files /dev/null and b/.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.stex differ diff --git a/.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.md5 b/.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.md5 new file mode 100644 index 0000000..cf26ba3 --- /dev/null +++ b/.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.md5 @@ -0,0 +1,3 @@ +source_md5="c9b25e023c273748623b084147e081da" +dest_md5="becb4d945324cebf9b34275dcc40b69d" + diff --git a/.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.stex b/.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.stex new file mode 100644 index 0000000..5e2c327 Binary files /dev/null and b/.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.stex differ diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 new file mode 100644 index 0000000..7b61c3e --- /dev/null +++ b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 @@ -0,0 +1,3 @@ +source_md5="47313fa4c47a9963fddd764e1ec6e4a8" +dest_md5="2ded9e7f9060e2b530aab678b135fc5b" + diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex new file mode 100644 index 0000000..3ca6461 Binary files /dev/null and b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex differ diff --git a/.import/light.png-06e94102f0cce323cff7daad56cf3030.md5 b/.import/light.png-06e94102f0cce323cff7daad56cf3030.md5 new file mode 100644 index 0000000..3f45c20 --- /dev/null +++ b/.import/light.png-06e94102f0cce323cff7daad56cf3030.md5 @@ -0,0 +1,3 @@ +source_md5="7fa6ef2827a0ab8776857290813b7275" +dest_md5="95cd43934ec86b0d318fdbef764d50be" + diff --git a/.import/light.png-06e94102f0cce323cff7daad56cf3030.stex b/.import/light.png-06e94102f0cce323cff7daad56cf3030.stex new file mode 100644 index 0000000..eabae96 Binary files /dev/null and b/.import/light.png-06e94102f0cce323cff7daad56cf3030.stex differ diff --git a/.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.md5 b/.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.md5 new file mode 100644 index 0000000..f9c2507 --- /dev/null +++ b/.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.md5 @@ -0,0 +1,3 @@ +source_md5="e4527ea39b903bc5f1fed9e59780aa86" +dest_md5="41f410b9dc50b93e65bce2dc2f2a5f9d" + diff --git a/.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.stex b/.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.stex new file mode 100644 index 0000000..905e78c Binary files /dev/null and b/.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.stex differ diff --git a/.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.md5 b/.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.md5 new file mode 100644 index 0000000..6212591 --- /dev/null +++ b/.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.md5 @@ -0,0 +1,3 @@ +source_md5="b02b4fd325409eec20969fbcb6e88dfb" +dest_md5="f9f6ed36c30ba000083c3b3f7994cfa8" + diff --git a/.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.mp3str b/.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.mp3str new file mode 100644 index 0000000..25ab5fe Binary files /dev/null and b/.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.mp3str differ diff --git a/.import/ship.png-232cf3806b465084ad9b06c70afe8991.md5 b/.import/ship.png-232cf3806b465084ad9b06c70afe8991.md5 new file mode 100644 index 0000000..1f3bf6a --- /dev/null +++ b/.import/ship.png-232cf3806b465084ad9b06c70afe8991.md5 @@ -0,0 +1,3 @@ +source_md5="995d8f68491f5e84df8d5fb3abb06157" +dest_md5="965d8647a51f6f961c14ed50a370b294" + diff --git a/.import/ship.png-232cf3806b465084ad9b06c70afe8991.stex b/.import/ship.png-232cf3806b465084ad9b06c70afe8991.stex new file mode 100644 index 0000000..e160dd8 Binary files /dev/null and b/.import/ship.png-232cf3806b465084ad9b06c70afe8991.stex differ diff --git a/Blip_Select10.wav b/Blip_Select10.wav new file mode 100644 index 0000000..deef097 Binary files /dev/null and b/Blip_Select10.wav differ diff --git a/Blip_Select10.wav.import b/Blip_Select10.wav.import new file mode 100644 index 0000000..7425176 --- /dev/null +++ b/Blip_Select10.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.sample" + +[deps] + +source_file="res://Blip_Select10.wav" +dest_files=[ "res://.import/Blip_Select10.wav-2060b5c57d013afd587fbf6823b7b2e0.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/Chain.gd b/Chain.gd new file mode 100644 index 0000000..f3f7682 --- /dev/null +++ b/Chain.gd @@ -0,0 +1,88 @@ +extends Node2D + +var velocity = 0 +var length = 0 +var speed = 50 +var bodies = Array() +var anchor: Node2D = null; +var linkRadius = 5; + +onready var linkTemplate: PackedScene = preload("res://ChainLink.tscn") +onready var anchorTemplate: PackedScene = preload("res://ChainAnchor.tscn") +onready var anim: AnimationPlayer = get_node("/root/UI/AnimationPlayer") + +func get_input(): + velocity = 0 + if (get_node("/root/Global").gameOver): + return; + if Input.is_action_pressed("down"): + velocity += 1 + if Input.is_action_pressed("up"): + velocity -= 1 + +func _physics_process(delta): + get_input(); + length = max(0, length + velocity*delta*speed); + updateBodies(); + +func _process(_delta): + if (is_instance_valid(anchor)): + get_node("../Camera2D").position = anchor.position; + get_node("../../Level/BackgroundNoise").volume_db = -25 + else: + get_node("../Camera2D").position = Vector2(0, 50); + get_node("../../Level/BackgroundNoise").volume_db = -15 + +func updateBodies(): + var num = floor(length / (linkRadius*2)); + #var rest = length - num * linkRadius*2; + while (bodies.size() < num): + var body = linkTemplate.instance() + var parentBody = get_parent(); + var p0 = Vector2(0, 0); + body.position = Vector2(p0.x, p0.y + linkRadius*2) + body.visible = true + bodies.push_front(body) + add_child(body) + + var joint = PinJoint2D.new() + joint.softness = 0.1; + joint.node_a = parentBody.get_path() + joint.node_b = body.get_path(); + body.add_child(joint); + + if (bodies.size() > 1): + var j1 = bodies[1].get_child(2); + j1.queue_free(); + bodies[1].position = Vector2(bodies[1].position.x, bodies[1].position.y + linkRadius*2) + j1 = PinJoint2D.new() + j1.softness = 0.1; + j1.node_a = body.get_path() + j1.node_b = bodies[1].get_path(); + bodies[1].add_child(j1); + else: + anchor = anchorTemplate.instance(); + anchor.position = Vector2(p0.x, p0.y + linkRadius*5) + add_child(anchor); + var j2 = PinJoint2D.new() + j2.position = Vector2(0, -3) + j2.softness = 0.1; + j2.node_a = body.get_path() + j2.node_b = anchor.get_path(); + anchor.add_child(j2); + anim.play("In") + while (bodies.size() > num): + bodies.pop_front().queue_free(); + if (bodies.size() > 0): + var j1 = bodies[0].get_child(2); + j1.queue_free(); + bodies[0].position = Vector2(0, linkRadius*2) + j1 = PinJoint2D.new() + j1.softness = 0.1; + j1.node_a = get_parent().get_path(); + j1.node_b = bodies[0].get_path(); + bodies[0].add_child(j1); + else: + anchor.queue_free() + anim.play("Out") + diff --git a/ChainAnchor.gd b/ChainAnchor.gd new file mode 100644 index 0000000..0f3bfd7 --- /dev/null +++ b/ChainAnchor.gd @@ -0,0 +1,43 @@ +extends RigidBody2D + +var crate: RigidBody2D; +var joint: DampedSpringJoint2D; +export (bool) var attached = false; +var nextLoss = 0.0; + +func _ready(): + pass # Replace with function body. + +#func _process(delta): +# pass + +func _input(event): + if event.is_action_pressed("jump") && is_instance_valid(crate) && (crate.global_position - global_position).length() < 20: + print("attach") + joint = DampedSpringJoint2D.new() + joint.node_a = self.get_path(); + joint.node_b = crate.get_path(); + joint.length = 10; + joint.rest_length = 10; + joint.stiffness = 64.0; + add_child(joint); + attached = true + get_node("/root/UI/Panel2/CrateImage").visible = true + elif event.is_action_pressed("jump") && is_instance_valid(joint): + print("detach") + joint.queue_free() + attached = false + get_node("/root/UI/Panel2/CrateImage").visible = false + +func _physics_process(delta): + nextLoss = clamp(nextLoss - delta, 0.0, 0.5) + for b in get_colliding_bodies(): + if b.collision_mask & 4 > 0 && nextLoss <= 0.0: + get_node("/root/Global").addPoints(-50) + $Hit.play(); + nextLoss = 0.5 + +func _on_Anchor_body_entered(body): + if body.collision_layer & 32 > 0: + crate = body; + print(crate); diff --git a/ChainAnchor.tscn b/ChainAnchor.tscn new file mode 100644 index 0000000..2a1ad9a --- /dev/null +++ b/ChainAnchor.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://hook.png" type="Texture" id=1] +[ext_resource path="res://ChainAnchor.gd" type="Script" id=2] +[ext_resource path="res://Hit_Hurt.wav" type="AudioStream" id=3] + +[sub_resource type="CircleShape2D" id=1] + +[node name="Anchor" type="RigidBody2D"] +collision_layer = 1025 +contacts_reported = 10 +contact_monitor = true +can_sleep = false +linear_damp = 3.139 +angular_damp = 1.0 +script = ExtResource( 2 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +position = Vector2( -0.0150032, 1.21534 ) +scale = Vector2( 0.102784, 0.102784 ) +texture = ExtResource( 1 ) + +[node name="Hit" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource( 3 ) + +[connection signal="body_entered" from="." to="." method="_on_Anchor_body_entered"] diff --git a/ChainLink.tscn b/ChainLink.tscn new file mode 100644 index 0000000..51229b6 --- /dev/null +++ b/ChainLink.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://chain.png" type="Texture" id=1] + +[sub_resource type="CircleShape2D" id=1] +radius = 5.0 + +[node name="ChainLink" type="RigidBody2D"] +collision_layer = 1026 +mass = 0.1 +can_sleep = false +linear_damp = 1.0 +angular_damp = 10.0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +scale = Vector2( 0.12, 0.12 ) +texture = ExtResource( 1 ) diff --git a/Crate.gd b/Crate.gd new file mode 100644 index 0000000..2649a96 --- /dev/null +++ b/Crate.gd @@ -0,0 +1,21 @@ +extends RigidBody2D + +signal collect; +var player: RigidBody2D; +var maxDepth = 0; + +var COLLECT_DIST = 75; + +# Called when the node enters the scene tree for the first time. +func _ready(): + player = get_node("/root/UI/ViewportContainerMain/Viewport/Game/Player"); + +func collect(): + get_node("/root/Global").addPoints(floor(maxDepth/75.0)*50); + emit_signal("collect", self) + queue_free(); + +func _physics_process(delta): + maxDepth = max(maxDepth, position.y) + if (player.global_position - global_position).length() < COLLECT_DIST: + collect(); diff --git a/Crate.tscn b/Crate.tscn new file mode 100644 index 0000000..565dd09 --- /dev/null +++ b/Crate.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://dollar-crate.png" type="Texture" id=1] +[ext_resource path="res://Crate.gd" type="Script" id=2] + +[sub_resource type="CapsuleShape2D" id=1] +radius = 5.80426 +height = 7.66226 + +[node name="Crate" type="RigidBody2D"] +position = Vector2( 250, 300 ) +collision_layer = 33 +collision_mask = 1025 +linear_damp = 2.0 +script = ExtResource( 2 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +rotation = 1.5708 +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +scale = Vector2( 0.15, 0.15 ) +texture = ExtResource( 1 ) diff --git a/Currents.tres b/Currents.tres new file mode 100644 index 0000000..fec3d9c --- /dev/null +++ b/Currents.tres @@ -0,0 +1,10 @@ +[gd_resource type="NoiseTexture" load_steps=2 format=2] + +[sub_resource type="OpenSimplexNoise" id=13] +octaves = 1 +period = 128.0 + +[resource] +width = 1024 +height = 1024 +noise = SubResource( 13 ) diff --git a/Game.tscn b/Game.tscn new file mode 100644 index 0000000..bfd087d --- /dev/null +++ b/Game.tscn @@ -0,0 +1,188 @@ +[gd_scene load_steps=19 format=2] + +[ext_resource path="res://Blip_Select10.wav" type="AudioStream" id=1] +[ext_resource path="res://ship.png" type="Texture" id=2] +[ext_resource path="res://light.png" type="Texture" id=3] +[ext_resource path="res://Player.gd" type="Script" id=4] +[ext_resource path="res://Water.gd" type="Script" id=5] +[ext_resource path="res://Currents.tres" type="Texture" id=6] +[ext_resource path="res://Chain.gd" type="Script" id=7] +[ext_resource path="res://Level.gd" type="Script" id=8] +[ext_resource path="res://noise.mp3" type="AudioStream" id=9] +[ext_resource path="res://Pickup_Coin29.wav" type="AudioStream" id=10] + +[sub_resource type="CircleShape2D" id=12] +radius = 15.702 + +[sub_resource type="OpenSimplexNoise" id=4] + +[sub_resource type="NoiseTexture" id=14] +noise = SubResource( 4 ) + +[sub_resource type="RectangleShape2D" id=15] +extents = Vector2( 1048.06, 233.71 ) + +[sub_resource type="Shader" id=11] +code = "shader_type particles; + +uniform sampler2D currents; +uniform float width; +uniform float height; + +float rand_from_seed(in uint seed) { + int k; + int s = int(seed); + if (s == 0) + s = 305420679; + k = s / 127773; + s = 16807 * (s - k * 127773) - 2836 * k; + if (s < 0) + s += 2147483647; + seed = uint(s); + return float(seed % uint(65536)) / 65535.0; +} + +uint hash(uint x) { + x = ((x >> uint(16)) ^ x) * uint(73244475); + x = ((x >> uint(16)) ^ x) * uint(73244475); + x = (x >> uint(16)) ^ x; + return x; +} + +void vertex() { + if (RESTART) { + uint alt_seed1 = hash(NUMBER + uint(1) + RANDOM_SEED); + uint alt_seed2 = hash(NUMBER + uint(27) + RANDOM_SEED); + uint alt_seed3 = hash(NUMBER + uint(43) + RANDOM_SEED); + CUSTOM.x = rand_from_seed(alt_seed1); + CUSTOM.y = TIME; + vec3 position = vec3((rand_from_seed(alt_seed2) * 2.0 - 1.0) * width, + (rand_from_seed(alt_seed3) * 2.0 - 1.0) * height, + 0); + TRANSFORM[3].xyz = position; + COLOR.a = 0.0; + } else { + vec4 col = texture(currents, vec2((TRANSFORM[3].x/width + 1.0) / 2.0, (TRANSFORM[3].y/height + 1.0) / 2.0)); + VELOCITY.x = (col.x-0.5)*100.0; + float t = clamp((TIME - CUSTOM.y)/LIFETIME, 0.0, 1.0); + float t2 = clamp(t*10.0, 0.0, 1.0); + COLOR.a = (1.0 - t)*t2; + } +}" + +[sub_resource type="ShaderMaterial" id=16] +shader = SubResource( 11 ) +shader_param/width = 100.0 +shader_param/height = 100.0 +shader_param/currents = ExtResource( 6 ) + +[sub_resource type="OpenSimplexNoise" id=17] +octaves = 4 + +[sub_resource type="NoiseTexture" id=18] +width = 1024 +height = 1024 +seamless = true +noise = SubResource( 17 ) + +[node name="Game" type="Node2D"] + +[node name="Player" type="RigidBody2D" parent="."] +position = Vector2( 230.741, 148.46 ) +collision_layer = 1537 +mass = 10.0 +can_sleep = false +linear_damp = 2.215 +angular_damp = 21.419 +script = ExtResource( 4 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] +shape = SubResource( 12 ) + +[node name="Camera2D" type="Camera2D" parent="Player"] +position = Vector2( 0, 50 ) +current = true +zoom = Vector2( 0.33, 0.33 ) +smoothing_enabled = true +smoothing_speed = 2.0 + +[node name="Sprite" type="Sprite" parent="Player"] +position = Vector2( 0, -9.873 ) +scale = Vector2( 0.2, 0.2 ) +texture = ExtResource( 2 ) + +[node name="Chain" type="Node2D" parent="Player"] +position = Vector2( -45, -10 ) +script = ExtResource( 7 ) + +[node name="Light2D" type="Light2D" parent="Player"] +position = Vector2( 39.3051, -2.9583 ) +scale = Vector2( 0.100925, 0.102306 ) +texture = ExtResource( 3 ) +color = Color( 1, 0.917647, 0.639216, 1 ) +energy = 0.42 + +[node name="Light2D2" type="Light2D" parent="Player"] +position = Vector2( -28.6511, -4.50342 ) +scale = Vector2( 0.139698, 0.124087 ) +texture = ExtResource( 3 ) +color = Color( 1, 0.886275, 0.694118, 1 ) +energy = 0.44 + +[node name="SonarPing" type="AudioStreamPlayer2D" parent="Player"] +stream = ExtResource( 1 ) + +[node name="Level" type="StaticBody2D" parent="."] +collision_mask = 5 +script = ExtResource( 8 ) + +[node name="CollectSound" type="AudioStreamPlayer" parent="Level"] +stream = ExtResource( 10 ) +volume_db = -3.939 + +[node name="BackgroundNoise" type="AudioStreamPlayer" parent="Level"] +stream = ExtResource( 9 ) +volume_db = -15.757 +autoplay = true + +[node name="WaterArea" type="Area2D" parent="Level"] +collision_mask = 512 +script = ExtResource( 5 ) +texture = SubResource( 14 ) +color = Color( 0.278431, 0.678431, 1, 0.662745 ) +currents = ExtResource( 6 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Level/WaterArea"] +position = Vector2( 1049.82, 411.434 ) +shape = SubResource( 15 ) + +[node name="Particles2D" type="Particles2D" parent="Level/WaterArea"] +position = Vector2( 1050.46, 412.221 ) +amount = 2000 +lifetime = 5.0 +preprocess = 5.0 +process_material = SubResource( 16 ) + +[node name="Polygon2D" type="Polygon2D" parent="Level"] +position = Vector2( 83.0141, 199.209 ) +scale = Vector2( 1.08553, 1.04479 ) +color = Color( 0.55, 0.249333, 0.099, 1 ) +texture = SubResource( 18 ) +polygon = PoolVector2Array( 10.7176, -61.6618, 72.1483, -31.6956, 103.613, 34.2299, 132.081, 109.145, 215.986, 76.1825, 256.44, 110.644, 275.918, 178.067, 278.915, 170.576, 355.328, 89.6673, 419.755, 128.623, 443.728, 178.067, 470.698, 112.142, 532.129, 152.596, 563.593, 212.528, 581.573, 221.518, 634.013, 172.074, 658.76, 249.847, 687.064, 324.886, 734.887, 367.476, 768.071, 212.327, 768.861, 142.108, 798.827, 166.081, 813.81, 101.654, 840.78, 143.606, 843.776, 80.6774, 865.514, 98.961, 916.421, 311.703, 940.569, 356.157, 996.451, 386.743, 1030.61, 266.072, 1100.88, 362.406, 1178.99, 275.198, 1179.97, 378.63, 1268.78, 315.76, 1322.46, 314.746, 1351.74, 290.409, 1350.77, 343.139, 1319.54, 389.785, 1439.58, 381.673, 1531.35, 228.532, 1493.33, 169.277, 1597.15, 105.464, 1579.61, 261.957, 1632.83, 356.322, 1784.99, 400.939, 1799.63, 3.43417, 1837.64, -81.4155, 2001.42, -79.8962, 2004.34, 565.827, -75.9321, 564.308, -76.1842, -52.6719 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Level"] +visible = false +position = Vector2( 83.0141, 199.209 ) +scale = Vector2( 1.08553, 1.04479 ) +polygon = PoolVector2Array( 10.7176, -61.6618, 72.1483, -31.6956, 103.613, 34.2299, 132.081, 109.145, 215.986, 76.1825, 256.44, 110.644, 275.918, 178.067, 278.915, 170.576, 355.328, 89.6673, 419.755, 128.623, 443.728, 178.067, 470.698, 112.142, 532.129, 152.596, 563.593, 212.528, 581.573, 221.518, 634.013, 172.074, 658.76, 249.847, 687.064, 324.886, 734.887, 367.476, 768.071, 212.327, 768.861, 142.108, 798.827, 166.081, 813.81, 101.654, 840.78, 143.606, 843.776, 80.6774, 865.514, 98.961, 916.421, 311.703, 940.569, 356.157, 996.451, 386.743, 1030.61, 266.072, 1100.88, 362.406, 1178.99, 275.198, 1179.97, 378.63, 1268.78, 315.76, 1322.46, 314.746, 1351.74, 290.409, 1350.77, 343.139, 1319.54, 389.785, 1439.58, 381.673, 1531.35, 228.532, 1493.33, 169.277, 1597.15, 105.464, 1579.61, 261.957, 1632.83, 356.322, 1784.99, 400.939, 1799.63, 3.43417, 1837.64, -81.4155, 2001.42, -79.8962, 2004.34, 565.827, -75.9321, 564.308, -76.1842, -52.6719 ) +__meta__ = { +"_editor_description_": "" +} + +[node name="Timer" type="Timer" parent="Level"] +wait_time = 0.5 +autostart = true + +[connection signal="body_entered" from="Level/WaterArea" to="Level/WaterArea" method="_on_Area2D_body_entered"] +[connection signal="body_exited" from="Level/WaterArea" to="Level/WaterArea" method="_on_Area2D_body_exited"] +[connection signal="timeout" from="Level/Timer" to="Level" method="_on_Timer_timeout"] diff --git a/Hit_Hurt.wav b/Hit_Hurt.wav new file mode 100644 index 0000000..be9d6e6 Binary files /dev/null and b/Hit_Hurt.wav differ diff --git a/Hit_Hurt.wav.import b/Hit_Hurt.wav.import new file mode 100644 index 0000000..15d6861 --- /dev/null +++ b/Hit_Hurt.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.sample" + +[deps] + +source_file="res://Hit_Hurt.wav" +dest_files=[ "res://.import/Hit_Hurt.wav-e35a9a626e412bd050e57f54fb8f6f56.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/Level.gd b/Level.gd new file mode 100644 index 0000000..0059eba --- /dev/null +++ b/Level.gd @@ -0,0 +1,27 @@ +extends StaticBody2D + +onready var crateTemplate = preload("res://Crate.tscn"); +export (Array) var crates = Array() +var MAX_COUNT = 10; + +func spawn(): + var crate = crateTemplate.instance(); + crate.position = Vector2(rand_range(150, 1750), 250); + if (crate.position.x - get_node("../Player").position.x) < 400: + return; + add_child(crate); + move_child(crate, 0); + crate.connect("collect", self, "onCrateCollected"); + crates.append(crate) + +func _process(delta): + pass + +func onCrateCollected(crate): + crates.erase(crate) + $CollectSound.play() + get_node("/root/UI/Panel2/CrateImage").visible = false + +func _on_Timer_timeout(): + if (crates.size() < MAX_COUNT): + spawn(); diff --git a/Pickup_Coin29.wav b/Pickup_Coin29.wav new file mode 100644 index 0000000..1086b81 Binary files /dev/null and b/Pickup_Coin29.wav differ diff --git a/Pickup_Coin29.wav.import b/Pickup_Coin29.wav.import new file mode 100644 index 0000000..84b6772 --- /dev/null +++ b/Pickup_Coin29.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.sample" + +[deps] + +source_file="res://Pickup_Coin29.wav" +dest_files=[ "res://.import/Pickup_Coin29.wav-d34061ac252572ab846e6b97dd73d2e1.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/Player.gd b/Player.gd new file mode 100644 index 0000000..72808ba --- /dev/null +++ b/Player.gd @@ -0,0 +1,41 @@ +extends RigidBody2D + +export (int) var speedForward = 1500 +export (int) var speedBack = 500 +var nextPing = 3.0; + +var velocity = Vector2() + +func get_input(): + velocity = Vector2() + if (get_node("/root/Global").gameOver): + return; + if Input.is_action_pressed("right"): + velocity.x += 1 + if Input.is_action_pressed("left"): + velocity.x -= 1 + + #var anchor = get_node("Chain/Anchor"); + #if !(is_instance_valid(anchor) && anchor.attached): + # scale = Vector2(velocity.x if abs(velocity.x) > 0 else scale.x, 1) + + velocity = velocity.normalized() * speedForward + +func _process(delta): + var crates = get_node("../Level").crates; + var dist = 10000.0; + for crate in crates: + dist = min(dist, abs(crate.position.x - position.x)); + var factor = clamp(5.0 - (dist/100.0), 1.0, 5.0) + nextPing -= delta*factor + if (nextPing < 0): + nextPing = 3.0; + $SonarPing.play() + +func _physics_process(_delta): + applied_force = Vector2(); + applied_torque = 0; + #scale = Vector2(-1, 1); + get_input() + add_central_force(velocity); + get_node("/root/UI/ViewportContainer/Viewport/MiniCamera").position = position; diff --git a/Roboto-Medium.ttf b/Roboto-Medium.ttf new file mode 100644 index 0000000..e89b0b7 Binary files /dev/null and b/Roboto-Medium.ttf differ diff --git a/UI.gd b/UI.gd new file mode 100644 index 0000000..643f4a8 --- /dev/null +++ b/UI.gd @@ -0,0 +1,5 @@ +extends Control + +func _ready(): + var world = $ViewportContainerMain/Viewport.find_world_2d() + $ViewportContainer/Viewport.world_2d = world diff --git a/UI.tscn b/UI.tscn new file mode 100644 index 0000000..216476a --- /dev/null +++ b/UI.tscn @@ -0,0 +1,261 @@ +[gd_scene load_steps=13 format=2] + +[ext_resource path="res://Game.tscn" type="PackedScene" id=1] +[ext_resource path="res://UI.gd" type="Script" id=2] +[ext_resource path="res://dollar-crate.png" type="Texture" id=3] + +[sub_resource type="Animation" id=1] +resource_name = "In" +tracks/0/type = "value" +tracks/0/path = NodePath("ViewportContainer:rect_position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 1000, 24 ), Vector2( 800, 24 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("ViewportContainer:rect_size") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 200, 120 ) ] +} + +[sub_resource type="Animation" id=2] +resource_name = "Out" +tracks/0/type = "value" +tracks/0/path = NodePath("ViewportContainer:rect_position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 800, 24 ), Vector2( 1000, 24 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("ViewportContainer:rect_size") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 200, 120 ), Vector2( 0, 0 ) ] +} + +[sub_resource type="Gradient" id=7] +offsets = PoolRealArray( 0, 0.241026, 1 ) +colors = PoolColorArray( 0.939453, 0.915485, 0.660553, 1, 0.395279, 0.528976, 0.613281, 1, 0, 0, 0, 1 ) + +[sub_resource type="GradientTexture" id=8] +gradient = SubResource( 7 ) + +[sub_resource type="StyleBoxTexture" id=9] +texture = SubResource( 8 ) +region_rect = Rect2( 0, 0, 2048, 1 ) + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0, 0, 0, 0.231373 ) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color( 0.662745, 0, 0, 1 ) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxFlat" id=4] +bg_color = Color( 0, 0, 0, 0.670588 ) + +[sub_resource type="DynamicFontData" id=5] +font_path = "res://Roboto-Medium.ttf" + +[sub_resource type="DynamicFont" id=6] +size = 36 +outline_size = 2 +outline_color = Color( 0.529412, 0.0823529, 0.0823529, 1 ) +font_data = SubResource( 5 ) + +[node name="UI" type="Control"] +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/In = SubResource( 1 ) +anims/Out = SubResource( 2 ) + +[node name="ViewportContainerMain" type="ViewportContainer" parent="."] +margin_top = -3.65913 +margin_right = 1024.0 +margin_bottom = 596.341 +stretch = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Viewport" type="Viewport" parent="ViewportContainerMain"] +size = Vector2( 1024, 600 ) +handle_input_locally = false +render_target_update_mode = 3 +audio_listener_enable_2d = true + +[node name="Bg" type="Panel" parent="ViewportContainerMain/Viewport"] +margin_left = 2442.0 +margin_top = -4.0 +margin_right = 3052.0 +margin_bottom = 2441.0 +rect_rotation = 90.0 +custom_styles/panel = SubResource( 9 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Game" parent="ViewportContainerMain/Viewport" instance=ExtResource( 1 )] + +[node name="ViewportContainer" type="ViewportContainer" parent="."] +margin_left = 1000.0 +margin_top = 24.0 +margin_right = 1000.0 +margin_bottom = 24.0 +stretch = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Viewport" type="Viewport" parent="ViewportContainer"] +handle_input_locally = false +render_target_update_mode = 3 + +[node name="MiniCamera" type="Camera2D" parent="ViewportContainer/Viewport"] +position = Vector2( 100, 100 ) +current = true + +[node name="Panel" type="Panel" parent="."] +margin_left = 9.0 +margin_top = 8.0 +margin_right = 107.0 +margin_bottom = 44.0 +custom_styles/panel = SubResource( 3 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ScoreLabel" type="Label" parent="Panel"] +anchor_left = 0.146 +anchor_top = 0.287 +anchor_right = 0.541 +anchor_bottom = 0.393 +text = "Score: 0" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel3" type="Panel" parent="."] +margin_left = 9.0 +margin_top = 53.0 +margin_right = 107.0 +margin_bottom = 86.0 +custom_styles/panel = SubResource( 3 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TimeLabel" type="Label" parent="Panel3"] +anchor_left = 0.146 +anchor_top = 0.287 +anchor_right = 0.541 +anchor_bottom = 0.393 +text = "Time: 5:00" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel2" type="Panel" parent="."] +margin_left = 8.0 +margin_top = 94.5311 +margin_right = 107.0 +margin_bottom = 154.531 +custom_styles/panel = SubResource( 3 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CrateImage" type="TextureRect" parent="Panel2"] +visible = false +margin_left = 11.0 +margin_top = 11.0 +margin_right = 88.0 +margin_bottom = 47.0 +texture = ExtResource( 3 ) +expand = true +stretch_mode = 6 + +[node name="GameOverScreen" type="Panel" parent="."] +visible = false +margin_right = 1022.0 +margin_bottom = 597.0 +custom_styles/panel = SubResource( 4 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="GameOverScreen"] +margin_left = 168.0 +margin_top = 118.0 +margin_right = 816.0 +margin_bottom = 446.0 +custom_fonts/font = SubResource( 6 ) +text = "Texting" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="IntroScreen" type="Panel" parent="."] +margin_right = 1022.0 +margin_bottom = 597.0 +custom_styles/panel = SubResource( 4 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="IntroScreen"] +margin_left = 82.6929 +margin_top = 86.5711 +margin_right = 928.693 +margin_bottom = 497.571 +custom_fonts/font = SubResource( 6 ) +text = "Welcome to Shipwrecked! + +Controls: +Left/Right: Move +Up/Down: Raise/Lower Chain +Space: Pickup + +Salvage as many crates as you can within 5 minutes. +Good Luck!" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/Water.gd b/Water.gd new file mode 100644 index 0000000..e14c1a3 --- /dev/null +++ b/Water.gd @@ -0,0 +1,111 @@ +extends Area2D + +export (Texture) var texture; +export (Color) var color; +export (Texture) var currents; + +var t = 0; +var intensity = 2.0; +var currentStrength = 100.0; +var player: RigidBody2D; +var anchor: RigidBody2D; +var points: PoolVector2Array; +var uvs: PoolVector2Array; +var affectedByCurrents = Array(); + +onready var collider = $CollisionShape2D; +var currentsImage: Image; + +func _ready(): + $Particles2D.process_material.set_shader_param("width", $CollisionShape2D.shape.extents.x); + $Particles2D.process_material.set_shader_param("height", $CollisionShape2D.shape.extents.y); + $Particles2D.visibility_rect = Rect2(-$CollisionShape2D.shape.extents, $CollisionShape2D.shape.extents*2) + yield(currents, "changed"); + currentsImage = currents.get_data(); + points = PoolVector2Array() + points.resize(collider.shape.extents.x * 2 + 4) + uvs = PoolVector2Array() + uvs.resize(collider.shape.extents.x * 2 + 4) + for i in range(points.size()): + points[i] = Vector2() + uvs[i] = Vector2() + +func updatePoly(start, end): + var height = end.y - start.y; + var width = end.x - start.x; + points[0] = start + uvs[0] = Vector2(0, 0) + + for i in range(width + 1): + var dist = 0.9*i/width + 0.1; + var wave1 = sin(t*2 + i/10.0)*3*dist*intensity; + var wave2 = sin(t*5 + i/7.0)*1*dist*intensity; + var wave3 = sin(t*3 + i/2.0)*0.5*dist*intensity; + var wave4 = sin(-t*7 + i/1.5)*0.25*dist*intensity; + var wave = wave1 + wave2 + wave3 + wave4; + points[i+1].x = start.x + i + points[i+1].y = start.y + wave + uvs[i+1].x = i/width + uvs[i+1].y = wave/height + points[width+2] = end + uvs[width+2] = Vector2(1, 1) + points[width+3] = Vector2(start.x, end.y) + uvs[width+3] = Vector2(0, 1) + +func drawPoly(fillColor): + var colors = PoolColorArray([fillColor]) + draw_polygon(points, colors, uvs, texture) + +func _draw(): + drawPoly(color) + +func _process(delta): + t += delta; + updatePoly(collider.position - collider.shape.extents, collider.position + collider.shape.extents) + update(); + +func _physics_process(delta): + if (player != null): + floatPlayer(delta); + applyCurrents(delta); + +func getCurrentAt(p: Vector2): + var pos = collider.to_local(p); + var uv = Vector2(clamp((1.0 + pos.x / collider.shape.extents.x) / 2.0, 0.0, 1.0), + clamp((1.0 + pos.y / collider.shape.extents.y) / 2.0, 0.0, 1.0)) + currentsImage.lock(); + var col = currentsImage.get_pixelv(uv * currentsImage.get_size()); + currentsImage.unlock(); + return col.r * 2.0 - 1.0; + +func applyCurrents(delta): + for body in affectedByCurrents: + var bodyCurrent = getCurrentAt(body.global_position); + body.apply_impulse(Vector2(), Vector2(bodyCurrent*delta*currentStrength*body.mass, 0)); + + #var playerCurrent = getCurrentAt(player.global_position); + #player.apply_impulse(Vector2(), Vector2(playerCurrent*delta*200.0, 0)); + #if (anchor): + # var anchorCurrent = getCurrentAt(anchor.global_position); + # print(anchorCurrent); + # anchor.apply_impulse(Vector2(), Vector2(anchorCurrent*delta*100.0, 0)); + +func floatPlayer(delta): + for p in points: + if abs(p.x - player.position.x) < 15: + var depth = p.y - player.position.y - 10; + var dx = (p.x - player.position.x)*sin(player.rotation)*7.0; + if (depth < 0): + player.apply_impulse(player.position - p, Vector2(0, depth + dx)*delta*20) + +func _on_Area2D_body_entered(body): + if (body.collision_layer & 512 > 0): + player = body; + if (body.collision_layer & 1024 > 0): + affectedByCurrents.append(body); + +func _on_Area2D_body_exited(body): + if (body.collision_layer & 512 > 0): + player = null; + if (body.collision_layer & 1024 > 0): + affectedByCurrents.erase(body); diff --git a/ball-grey.png b/ball-grey.png new file mode 100644 index 0000000..8087071 Binary files /dev/null and b/ball-grey.png differ diff --git a/ball-grey.png.import b/ball-grey.png.import new file mode 100644 index 0000000..cc8147d --- /dev/null +++ b/ball-grey.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ball-grey.png" +dest_files=[ "res://.import/ball-grey.png-d00286a716a96ecf7a9105009576e182.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/chain.png b/chain.png new file mode 100644 index 0000000..32c47bf Binary files /dev/null and b/chain.png differ diff --git a/chain.png.import b/chain.png.import new file mode 100644 index 0000000..eecdf25 --- /dev/null +++ b/chain.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/chain.png-40a65e105e3052733dfec7f73e6a2028.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://chain.png" +dest_files=[ "res://.import/chain.png-40a65e105e3052733dfec7f73e6a2028.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/default_env.tres b/default_env.tres new file mode 100644 index 0000000..20207a4 --- /dev/null +++ b/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) diff --git a/dollar-crate.png b/dollar-crate.png new file mode 100644 index 0000000..57f93d8 Binary files /dev/null and b/dollar-crate.png differ diff --git a/dollar-crate.png.import b/dollar-crate.png.import new file mode 100644 index 0000000..a1203ff --- /dev/null +++ b/dollar-crate.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://dollar-crate.png" +dest_files=[ "res://.import/dollar-crate.png-c7b060f615d26f65f1a5f12f910cbf9b.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..8e64da7 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,98 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="./Ludum48.exe" +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PoolStringArray( ) +application/icon="" +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" + +[preset.1] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="./Ludum48.x86_64" +script_export_mode=1 +script_encryption_key="" + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true + +[preset.2] + +name="Mac OSX" +platform="Mac OSX" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="./Ludum48.zip" +script_export_mode=1 +script_encryption_key="" + +[preset.2.options] + +custom_template/debug="" +custom_template/release="" +application/name="" +application/info="Made with Godot Engine" +application/icon="" +application/identifier="" +application/signature="" +application/short_version="1.0" +application/version="1.0" +application/copyright="" +display/high_res=false +privacy/camera_usage_description="" +privacy/microphone_usage_description="" +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false diff --git a/global.gd b/global.gd new file mode 100644 index 0000000..98fe7bb --- /dev/null +++ b/global.gd @@ -0,0 +1,19 @@ +extends Node2D + +export (int) var points = 0; +var time = 5*60.0; +export (bool) var gameOver = false; + +func addPoints(amount: int): + points += amount; + get_node("/root/UI/Panel/ScoreLabel").text = "Score: %d" % [points] + +func _process(delta): + time = max(time - delta, 0.0); + if (time <= 5*60.0-5): + get_node("/root/UI/IntroScreen").visible = false; + if (time <= 0): + gameOver = true; + get_node("/root/UI/GameOverScreen/Label").text = "Thank You For Playing!\n\nYour Score: %d" % [points]; + get_node("/root/UI/GameOverScreen").visible = true; + get_node("/root/UI/Panel3/TimeLabel").text = "Time: %d:%02d" % [floor(time/60.0), int(floor(time)) % 60] diff --git a/hook.png b/hook.png new file mode 100644 index 0000000..0e05714 Binary files /dev/null and b/hook.png differ diff --git a/hook.png.import b/hook.png.import new file mode 100644 index 0000000..ef3d73f --- /dev/null +++ b/hook.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://hook.png" +dest_files=[ "res://.import/hook.png-75e1f4fcaca6e01ae9951d13bcfec6f3.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..c98fbb6 Binary files /dev/null and b/icon.png differ diff --git a/icon.png.import b/icon.png.import new file mode 100644 index 0000000..96cbf46 --- /dev/null +++ b/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/light.png b/light.png new file mode 100644 index 0000000..02a6db5 Binary files /dev/null and b/light.png differ diff --git a/light.png.import b/light.png.import new file mode 100644 index 0000000..eb66a39 --- /dev/null +++ b/light.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/light.png-06e94102f0cce323cff7daad56cf3030.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://light.png" +dest_files=[ "res://.import/light.png-06e94102f0cce323cff7daad56cf3030.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/light256.png b/light256.png new file mode 100644 index 0000000..4c91044 Binary files /dev/null and b/light256.png differ diff --git a/light256.png.import b/light256.png.import new file mode 100644 index 0000000..297ef5e --- /dev/null +++ b/light256.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://light256.png" +dest_files=[ "res://.import/light256.png-a4c3c1f048850e66cf8dcc0e64bb5a94.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/noise.mp3 b/noise.mp3 new file mode 100644 index 0000000..f571372 Binary files /dev/null and b/noise.mp3 differ diff --git a/noise.mp3.import b/noise.mp3.import new file mode 100644 index 0000000..1e81217 --- /dev/null +++ b/noise.mp3.import @@ -0,0 +1,15 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +path="res://.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.mp3str" + +[deps] + +source_file="res://noise.mp3" +dest_files=[ "res://.import/noise.mp3-d8ed4762a41834bd51d826e5127cf656.mp3str" ] + +[params] + +loop=true +loop_offset=0 diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..00e4317 --- /dev/null +++ b/project.godot @@ -0,0 +1,59 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +[application] + +config/name="Ludum48" +run/main_scene="res://UI.tscn" +config/icon="res://icon.png" + +[autoload] + +Global="*res://global.gd" + +[input] + +left={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) + ] +} +right={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) + ] +} +up={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) + ] +} +down={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) + ] +} +jump={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) + ] +} + +[physics] + +common/enable_pause_aware_picking=true + +[rendering] + +environment/default_environment="res://default_env.tres" diff --git a/ship.png b/ship.png new file mode 100644 index 0000000..1819189 Binary files /dev/null and b/ship.png differ diff --git a/ship.png.import b/ship.png.import new file mode 100644 index 0000000..4ec3930 --- /dev/null +++ b/ship.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/ship.png-232cf3806b465084ad9b06c70afe8991.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ship.png" +dest_files=[ "res://.import/ship.png-232cf3806b465084ad9b06c70afe8991.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0