diff options
author | altaf-creator <dev@altafcreator.com> | 2025-03-09 17:05:54 +0800 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2025-03-09 17:05:54 +0800 |
commit | 79a5fedf7879da9b2395305e1b47f43e55f6d2aa (patch) | |
tree | d887250833eb0bda56d8e4cd3fe0521447911280 |
Initial commit. Prototype finished.main
-rw-r--r-- | .gitattributes | 2 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Asteroid.gd | 71 | ||||
-rw-r--r-- | Game.gd | 16 | ||||
-rw-r--r-- | GravityGun.gd | 73 | ||||
-rw-r--r-- | Gun.png | bin | 0 -> 10229 bytes | |||
-rw-r--r-- | Gun.png.import | 34 | ||||
-rw-r--r-- | GunRotation.gd | 15 | ||||
-rw-r--r-- | Player.gd | 19 | ||||
-rw-r--r-- | PlayerMovement.gd | 23 | ||||
-rw-r--r-- | Spawner.gd | 28 | ||||
-rw-r--r-- | UFO with a Gravity Gun.pck | bin | 0 -> 109216 bytes | |||
-rw-r--r-- | UFO.png | bin | 0 -> 18207 bytes | |||
-rw-r--r-- | UFO.png.import | 34 | ||||
-rw-r--r-- | asteroid.png | bin | 0 -> 2579 bytes | |||
-rw-r--r-- | asteroid.png.import | 34 | ||||
-rw-r--r-- | asteroid.tscn | 49 | ||||
-rw-r--r-- | cursor.png | bin | 0 -> 2547 bytes | |||
-rw-r--r-- | cursor.png.import | 34 | ||||
-rw-r--r-- | export_presets.cfg | 140 | ||||
-rw-r--r-- | gpu_particles_2d.tscn | 53 | ||||
-rw-r--r-- | gravityzone.png | bin | 0 -> 61373 bytes | |||
-rw-r--r-- | gravityzone.png.import | 34 | ||||
-rw-r--r-- | icon.svg | 1 | ||||
-rw-r--r-- | icon.svg.import | 37 | ||||
-rw-r--r-- | node_2d.tscn | 166 | ||||
-rw-r--r-- | normal.tscn | 51 | ||||
-rw-r--r-- | project.godot | 46 |
28 files changed, 962 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/Asteroid.gd b/Asteroid.gd new file mode 100644 index 0000000..8b93b24 --- /dev/null +++ b/Asteroid.gd @@ -0,0 +1,71 @@ +extends RigidBody2D + +@export var killer : bool +@export var posessed : bool +@export var persistent_linear_velocity : Vector2 +@export var particle_chad : PackedScene +@export var particle_virgin : PackedScene + +# 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 + #look_at(get_tree().get_root().get_node("Prototype/Player").position) + +func _physics_process(delta): + #global_position += linear_velocity + if persistent_linear_velocity != Vector2.ZERO: + linear_velocity = persistent_linear_velocity + pass + +func _on_area_entered(area): + if killer: + area.queue_free() + +func start_timebomb(): + $"LifeTimer".start() + +func _on_life_timer_timeout(): + queue_free() + +func _on_body_entered(body): + print(body.name) + if killer: + if body.name != "Player": + print("kill") + body.destroy(true) + else: + if !("killer" in body): + if posessed: + if body.name != "Player": + body.destroy() + else: + body.destroy() + elif body.killer: + return + else: + body.destroy() + +#func _on_area_2d_area_entered(area): +# pass # Replace with function body. + +#func _on_area_2d_body_entered(body): +# if killer: +# body.queue_free() + +func destroy(player_killed = false): + var part + + if player_killed: + part = particle_chad + else: + part = particle_virgin + + var new = part.instantiate() + new.position = global_position + new.emitting = true + get_tree().get_root().get_node("Prototype").add_child(new) + queue_free() @@ -0,0 +1,16 @@ +extends Node2D + +@export var player : RigidBody2D +@export_file("*.tscn") var scene : String +@export var ded_text : Label + +# 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): + if player == null: + ded_text.visible = true + if Input.is_action_just_pressed("ui_select"): + get_tree().change_scene_to_file(scene) diff --git a/GravityGun.gd b/GravityGun.gd new file mode 100644 index 0000000..0237fc6 --- /dev/null +++ b/GravityGun.gd @@ -0,0 +1,73 @@ +extends Node + +var using : bool +var capturing : bool + +var prev_using : bool + +@export var area : Area2D +@export var captured_body : RigidBody2D +@export var capture_anchor : Node2D +@export_range(0.0, 0.1) var current_strength : float +@export var close_range : float +@export var grab_speed : float +@export var throw_velocity : float + +var stored_velovity : Vector2 + +# 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 _physics_process(delta): + area.visible = using + + if using and capturing and captured_body != null: + var dist : Vector2 = capture_anchor.global_position - captured_body.global_position + var dir : Vector2 = dist.normalized() + var dis : float = sqrt(abs(abs(dist.x * dist.x) - abs(dist.y * dist.y))) # phytagoras! + print(dis) + + # captured_body.global_position = capture_anchor.global_position + + #if dis > close_range: + captured_body.apply_central_impulse(dir * grab_speed)# * (1 - (dis / close_range))) + + PhysicsServer2D.body_set_state( + captured_body.get_rid(), + PhysicsServer2D.BODY_STATE_TRANSFORM, + Transform2D.IDENTITY.translated(captured_body.global_position.lerp(capture_anchor.global_position, 0.1)) + ) + + # stored_velovity = captured_body.linear_velocity + #captured_body.linear_velocity = captured_body.linear_velocity.clamp(Vector2.ZERO, Vector2.ONE * 200) + #else: + # captured_body.linear_velocity = stored_velovity * (dis / close_range) # dis nuts + # captured_body.apply_central_impulse(dir * 1) + + if using != prev_using: + prev_using = using + + if !using && capturing and captured_body != null: + captured_body.persistent_linear_velocity = Vector2(sin($"..".rotation + deg_to_rad(90)), cos($"..".rotation + deg_to_rad(-90))) * throw_velocity + captured_body.killer = true + captured_body.start_timebomb() + captured_body = null + capturing = false + +func _input(event): + using = Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) + +func _on_gravity_area_2d_body_entered(body): + print(body) + if using && captured_body == null: + captured_body = body + captured_body.posessed = true + capturing = true + +func _on_gravity_area_2d_area_entered(area): + print(area) + if using && captured_body == null: + captured_body = area + capturing = true Binary files differdiff --git a/Gun.png.import b/Gun.png.import new file mode 100644 index 0000000..decfabb --- /dev/null +++ b/Gun.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpfxsieu5ykss" +path="res://.godot/imported/Gun.png-719d9323171cf2dec61a4f973c72372a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Gun.png" +dest_files=["res://.godot/imported/Gun.png-719d9323171cf2dec61a4f973c72372a.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/GunRotation.gd b/GunRotation.gd new file mode 100644 index 0000000..5398519 --- /dev/null +++ b/GunRotation.gd @@ -0,0 +1,15 @@ +extends Node + + +# 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): + var mouse_position : Vector2 = get_viewport().get_mouse_position() + var delta_x : float = mouse_position.x - $"..".global_position.x + var delta_y : float = mouse_position.y - $"..".global_position.y + + $"..".rotation = atan2(delta_y, delta_x) diff --git a/Player.gd b/Player.gd new file mode 100644 index 0000000..df31a9e --- /dev/null +++ b/Player.gd @@ -0,0 +1,19 @@ +extends RigidBody2D + +@export var particle : PackedScene + +# Called when the node enters the scene tree for the first time. +func _ready(): + position = Vector2(randf_range(100, 1180), randf_range(100, 620)) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func destroy(): + var new = particle.instantiate() + new.position = global_position + new.emitting = true + get_tree().get_root().get_node("Prototype").add_child(new) + queue_free() diff --git a/PlayerMovement.gd b/PlayerMovement.gd new file mode 100644 index 0000000..df9b002 --- /dev/null +++ b/PlayerMovement.gd @@ -0,0 +1,23 @@ +extends Node + +@export var speed : float +@export var velocity_dampening : float + +var target_velocity : Vector2 +var velocity : Vector2 + +# 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): + var input : Vector2 = Input.get_vector("left", "right", "up", "down") + target_velocity = input * delta * speed + + if input != Vector2.ZERO: + velocity = velocity.lerp(target_velocity, velocity_dampening * 2) + else: + velocity = velocity.lerp(target_velocity, velocity_dampening) + + $"..".position += velocity diff --git a/Spawner.gd b/Spawner.gd new file mode 100644 index 0000000..153d9bf --- /dev/null +++ b/Spawner.gd @@ -0,0 +1,28 @@ +extends Node + +@export var asteroid : PackedScene +@export var root : Node2D +@export var player : RigidBody2D +@export var v1 : Vector2 +@export var v2 : Vector2 +@export var speed : float + +# 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_timer_timeout(): + if player != null: + var new : RigidBody2D = asteroid.instantiate() + + new.position = Vector2(randf_range(v1.x, v2.x), randf_range(v1.y, v2.y)) + new.look_at(player.position) + new.linear_velocity = Vector2(0, speed).rotated(new.rotation + deg_to_rad(-90)) + root.add_child(new) + + $"Timer".wait_time = randf_range(1, 3) + $"Timer".start() diff --git a/UFO with a Gravity Gun.pck b/UFO with a Gravity Gun.pck Binary files differBinary files differnew file mode 100644 index 0000000..82a7714 --- /dev/null +++ b/UFO with a Gravity Gun.pck diff --git a/UFO.png.import b/UFO.png.import new file mode 100644 index 0000000..81cae35 --- /dev/null +++ b/UFO.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvi0mierwp5c" +path="res://.godot/imported/UFO.png-6b28bfc670ee81a0c16ac713fabd0bf3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://UFO.png" +dest_files=["res://.godot/imported/UFO.png-6b28bfc670ee81a0c16ac713fabd0bf3.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/asteroid.png b/asteroid.png Binary files differnew file mode 100644 index 0000000..d844d66 --- /dev/null +++ b/asteroid.png diff --git a/asteroid.png.import b/asteroid.png.import new file mode 100644 index 0000000..2ab43d3 --- /dev/null +++ b/asteroid.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnboio1l48kd2" +path="res://.godot/imported/asteroid.png-d2db2557ecd7f0d981e923efb6f92b62.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://asteroid.png" +dest_files=["res://.godot/imported/asteroid.png-d2db2557ecd7f0d981e923efb6f92b62.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/asteroid.tscn b/asteroid.tscn new file mode 100644 index 0000000..9ec6450 --- /dev/null +++ b/asteroid.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=8 format=3 uid="uid://hgwtxd5ttu4j"] + +[ext_resource type="Script" path="res://Asteroid.gd" id="1_c0kfw"] +[ext_resource type="Texture2D" uid="uid://dnboio1l48kd2" path="res://asteroid.png" id="2_qqbct"] +[ext_resource type="PackedScene" uid="uid://bpbf3mo6xvabj" path="res://gpu_particles_2d.tscn" id="2_wkn6x"] +[ext_resource type="PackedScene" uid="uid://c4ffo50o24wuy" path="res://normal.tscn" id="3_4kl4f"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_1j0j4"] +friction = 0.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_ml81o"] +radius = 21.0238 + +[sub_resource type="CircleShape2D" id="CircleShape2D_v6ydb"] +radius = 18.1108 + +[node name="Asteroid" type="RigidBody2D"] +collision_mask = 3 +physics_material_override = SubResource("PhysicsMaterial_1j0j4") +gravity_scale = 0.0 +can_sleep = false +max_contacts_reported = 10 +contact_monitor = true +script = ExtResource("1_c0kfw") +particle_chad = ExtResource("2_wkn6x") +particle_virgin = ExtResource("3_4kl4f") + +[node name="Asteroid" type="Sprite2D" parent="."] +scale = Vector2(0.45, 0.45) +texture = ExtResource("2_qqbct") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_ml81o") + +[node name="LifeTimer" type="Timer" parent="."] +wait_time = 5.0 + +[node name="Area2D" type="Area2D" parent="."] +visible = false +collision_layer = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +shape = SubResource("CircleShape2D_v6ydb") +debug_color = Color(0.623529, 0.533333, 0.121569, 0.419608) + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] +[connection signal="timeout" from="LifeTimer" to="." method="_on_life_timer_timeout"] +[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"] +[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"] diff --git a/cursor.png b/cursor.png Binary files differnew file mode 100644 index 0000000..17abb7b --- /dev/null +++ b/cursor.png diff --git a/cursor.png.import b/cursor.png.import new file mode 100644 index 0000000..524e08f --- /dev/null +++ b/cursor.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dc5yimqpot5uw" +path="res://.godot/imported/cursor.png-9207886fa5a62b74129e260ee150454e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cursor.png" +dest_files=["res://.godot/imported/cursor.png-9207886fa5a62b74129e260ee150454e.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/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..3ddc866 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,140 @@ +[preset.0] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="./UFO with a Gravity Gun.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.1] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="./UFO with a Gravity Gun.exe" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" + +[preset.2] + +name="Web" +platform="Web" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="Web Export/UFO with a Gravity Gun.html" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.2.options] + +custom_template/debug="" +custom_template/release="" +variant/extensions_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1) diff --git a/gpu_particles_2d.tscn b/gpu_particles_2d.tscn new file mode 100644 index 0000000..566e8a6 --- /dev/null +++ b/gpu_particles_2d.tscn @@ -0,0 +1,53 @@ +[gd_scene load_steps=8 format=3 uid="uid://bpbf3mo6xvabj"] + +[sub_resource type="Curve" id="Curve_key14"] +_data = [Vector2(0, 1), 0.0, -0.0831102, 0, 0, Vector2(0.826667, 0.582418), -1.73511, -1.73511, 0, 0, Vector2(1, 0), -2.84715, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_7fgoh"] +curve = SubResource("Curve_key14") + +[sub_resource type="Gradient" id="Gradient_qym4u"] +offsets = PackedFloat32Array(0.2, 0.554839, 1) +colors = PackedColorArray(1, 0, 0, 1, 1, 0.619608, 0.129412, 1, 0.41, 0.41, 0.41, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_rjjtp"] +gradient = SubResource("Gradient_qym4u") + +[sub_resource type="Curve" id="Curve_kdh7r"] +min_value = -200.0 +max_value = 200.0 +_data = [Vector2(0.0382514, 37.3626), 0.0, 0.0, 0, 0, Vector2(0.606557, -6.59341), 0.0, 0.0, 0, 0, Vector2(0.945355, -85.7143), -67.033, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_4o04g"] +curve = SubResource("Curve_kdh7r") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pslfe"] +lifetime_randomness = 0.67 +particle_flag_disable_z = true +emission_shape_scale = Vector3(10, 10, 10) +emission_shape = 1 +emission_sphere_radius = 0.01 +angle_min = -720.0 +angle_max = 630.9 +spread = 180.0 +initial_velocity_min = 100.0 +initial_velocity_max = 200.0 +gravity = Vector3(0, 0, 0) +linear_accel_min = 11.24 +linear_accel_max = 11.24 +linear_accel_curve = SubResource("CurveTexture_4o04g") +scale_min = 5.0 +scale_max = 15.0 +color_ramp = SubResource("GradientTexture1D_rjjtp") +alpha_curve = SubResource("CurveTexture_7fgoh") +turbulence_noise_strength = 0.0 + +[node name="GPUParticles2D" type="GPUParticles2D"] +position = Vector2(163, 123) +emitting = false +amount = 473 +process_material = SubResource("ParticleProcessMaterial_pslfe") +one_shot = true +explosiveness = 1.0 diff --git a/gravityzone.png b/gravityzone.png Binary files differnew file mode 100644 index 0000000..7ef0184 --- /dev/null +++ b/gravityzone.png diff --git a/gravityzone.png.import b/gravityzone.png.import new file mode 100644 index 0000000..b1fea0a --- /dev/null +++ b/gravityzone.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cprlo85m3uys1" +path="res://.godot/imported/gravityzone.png-434ce7c7e6102710cbb519377f91d1c6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://gravityzone.png" +dest_files=["res://.godot/imported/gravityzone.png-434ce7c7e6102710cbb519377f91d1c6.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/icon.svg b/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ +<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg> diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..daa64aa --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cjceltedj0up6" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/node_2d.tscn b/node_2d.tscn new file mode 100644 index 0000000..2ff94ae --- /dev/null +++ b/node_2d.tscn @@ -0,0 +1,166 @@ +[gd_scene load_steps=15 format=3 uid="uid://chw7i3lumyew3"] + +[ext_resource type="Texture2D" uid="uid://bpfxsieu5ykss" path="res://Gun.png" id="1_o2ly3"] +[ext_resource type="Script" path="res://Player.gd" id="1_tnqdd"] +[ext_resource type="Script" path="res://Game.gd" id="1_upopx"] +[ext_resource type="Script" path="res://GunRotation.gd" id="2_3kk03"] +[ext_resource type="Texture2D" uid="uid://bvi0mierwp5c" path="res://UFO.png" id="2_53irs"] +[ext_resource type="Script" path="res://GravityGun.gd" id="3_fabqc"] +[ext_resource type="Script" path="res://PlayerMovement.gd" id="4_27mrs"] +[ext_resource type="Texture2D" uid="uid://cprlo85m3uys1" path="res://gravityzone.png" id="5_lb6nj"] +[ext_resource type="PackedScene" uid="uid://hgwtxd5ttu4j" path="res://asteroid.tscn" id="7_h5xye"] +[ext_resource type="Script" path="res://Spawner.gd" id="8_p37o5"] +[ext_resource type="PackedScene" uid="uid://bpbf3mo6xvabj" path="res://gpu_particles_2d.tscn" id="9_b63nq"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_yhomi"] +radius = 20.0 + +[sub_resource type="LabelSettings" id="LabelSettings_yijtf"] +font_size = 64 +font_color = Color(1, 1, 1, 0.188235) + +[sub_resource type="LabelSettings" id="LabelSettings_778je"] +font_size = 32 +outline_size = 15 +outline_color = Color(0, 0, 0.0666667, 1) + +[node name="Prototype" type="Node2D" node_paths=PackedStringArray("player", "ded_text")] +script = ExtResource("1_upopx") +player = NodePath("Player") +scene = "res://node_2d.tscn" +ded_text = NodePath("Label") + +[node name="Player" type="RigidBody2D" parent="."] +position = Vector2(577, 265) +collision_layer = 3 +collision_mask = 0 +gravity_scale = 0.0 +script = ExtResource("1_tnqdd") +particle = ExtResource("9_b63nq") + +[node name="Gun" type="Sprite2D" parent="Player"] +scale = Vector2(0.2, 0.2) +texture = ExtResource("1_o2ly3") + +[node name="GunRotation" type="Node" parent="Player/Gun"] +script = ExtResource("2_3kk03") + +[node name="GravityGun" type="Node" parent="Player/Gun" node_paths=PackedStringArray("area", "capture_anchor")] +script = ExtResource("3_fabqc") +area = NodePath("../GravityArea2D") +capture_anchor = NodePath("../GravityArea2D/CaptureAnchor") +close_range = 1.0 +grab_speed = 15.0 +throw_velocity = 1500.0 + +[node name="GravityArea2D" type="Area2D" parent="Player/Gun"] +position = Vector2(560, -72) +rotation = 1.54879 +scale = Vector2(1.24059, 1.47599) +collision_layer = 0 + +[node name="Gravityzone" type="Sprite2D" parent="Player/Gun/GravityArea2D"] +texture = ExtResource("5_lb6nj") + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Player/Gun/GravityArea2D"] +build_mode = 1 +polygon = PackedVector2Array(193.207, -183.529, 142.227, 42.9501, 46.6261, 263.695, -38.191, 263.762, -90.4009, 48.6971, -210.07, -207.935) + +[node name="CaptureAnchor" type="Node2D" parent="Player/Gun/GravityArea2D"] + +[node name="UFO" type="Sprite2D" parent="Player"] +scale = Vector2(0.15, 0.15) +texture = ExtResource("2_53irs") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] +position = Vector2(-3, 1) +shape = SubResource("CircleShape2D_yhomi") + +[node name="PlayerMovement" type="Node" parent="Player"] +script = ExtResource("4_27mrs") +speed = 250.0 +velocity_dampening = 0.05 + +[node name="Spawner" type="Node" parent="." node_paths=PackedStringArray("root", "player")] +script = ExtResource("8_p37o5") +asteroid = ExtResource("7_h5xye") +root = NodePath("..") +player = NodePath("../Player") +v1 = Vector2(0, -30) +v2 = Vector2(1280, -30) +speed = 200.0 + +[node name="Timer" type="Timer" parent="Spawner"] +autostart = true + +[node name="Spawner2" type="Node" parent="." node_paths=PackedStringArray("root", "player")] +script = ExtResource("8_p37o5") +asteroid = ExtResource("7_h5xye") +root = NodePath("..") +player = NodePath("../Player") +v1 = Vector2(0, 750) +v2 = Vector2(1280, 750) +speed = 200.0 + +[node name="Timer" type="Timer" parent="Spawner2"] +wait_time = 2.0 +autostart = true + +[node name="Spawner3" type="Node" parent="." node_paths=PackedStringArray("root", "player")] +script = ExtResource("8_p37o5") +asteroid = ExtResource("7_h5xye") +root = NodePath("..") +player = NodePath("../Player") +v1 = Vector2(-30, 0) +v2 = Vector2(-30, 720) +speed = 200.0 + +[node name="Timer" type="Timer" parent="Spawner3"] +wait_time = 3.0 +autostart = true + +[node name="Spawner4" type="Node" parent="." node_paths=PackedStringArray("root", "player")] +script = ExtResource("8_p37o5") +asteroid = ExtResource("7_h5xye") +root = NodePath("..") +player = NodePath("../Player") +v1 = Vector2(1300, 0) +v2 = Vector2(1300, 720) +speed = 200.0 + +[node name="Timer" type="Timer" parent="Spawner4"] +autostart = true + +[node name="Label" type="Label" parent="."] +visible = false +custom_minimum_size = Vector2(1280, 720) +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = 1280.0 +offset_bottom = 720.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_vertical = 1 +text = "yuo are ded +space to replay this bad game" +label_settings = SubResource("LabelSettings_yijtf") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Score" type="Label" parent="."] +visible = false +z_index = 100 +offset_right = 1280.0 +offset_bottom = 61.0 +text = "0" +label_settings = SubResource("LabelSettings_778je") +horizontal_alignment = 1 +vertical_alignment = 1 + +[connection signal="area_entered" from="Player/Gun/GravityArea2D" to="Player/Gun/GravityGun" method="_on_gravity_area_2d_area_entered"] +[connection signal="body_entered" from="Player/Gun/GravityArea2D" to="Player/Gun/GravityGun" method="_on_gravity_area_2d_body_entered"] +[connection signal="timeout" from="Spawner/Timer" to="Spawner" method="_on_timer_timeout"] +[connection signal="timeout" from="Spawner2/Timer" to="Spawner2" method="_on_timer_timeout"] +[connection signal="timeout" from="Spawner3/Timer" to="Spawner3" method="_on_timer_timeout"] +[connection signal="timeout" from="Spawner4/Timer" to="Spawner4" method="_on_timer_timeout"] diff --git a/normal.tscn b/normal.tscn new file mode 100644 index 0000000..6856ee5 --- /dev/null +++ b/normal.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=8 format=3 uid="uid://c4ffo50o24wuy"] + +[sub_resource type="Curve" id="Curve_key14"] +_data = [Vector2(0, 1), 0.0, -0.0831102, 0, 0, Vector2(0.826667, 0.582418), -1.73511, -1.73511, 0, 0, Vector2(1, 0), -2.84715, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_7fgoh"] +curve = SubResource("Curve_key14") + +[sub_resource type="Gradient" id="Gradient_qym4u"] +offsets = PackedFloat32Array(0.2, 0.554839, 1) +colors = PackedColorArray(0.7, 0.422567, 0.294, 1, 0.52, 0.429867, 0.312, 1, 0.41, 0.41, 0.41, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_rjjtp"] +gradient = SubResource("Gradient_qym4u") + +[sub_resource type="Curve" id="Curve_7via6"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_4o04g"] +curve = SubResource("Curve_7via6") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pslfe"] +lifetime_randomness = 0.67 +particle_flag_disable_z = true +emission_shape_scale = Vector3(10, 10, 10) +emission_shape = 1 +emission_sphere_radius = 0.01 +angle_min = -720.0 +angle_max = 630.9 +spread = 180.0 +initial_velocity_min = 70.0 +initial_velocity_max = 140.0 +gravity = Vector3(0, 0, 0) +linear_accel_min = 5.53 +linear_accel_max = 7.43 +linear_accel_curve = SubResource("CurveTexture_4o04g") +scale_min = 3.0 +scale_max = 7.0 +color_ramp = SubResource("GradientTexture1D_rjjtp") +alpha_curve = SubResource("CurveTexture_7fgoh") +turbulence_noise_strength = 0.0 + +[node name="GPUParticles2D" type="GPUParticles2D"] +position = Vector2(163, 123) +emitting = false +amount = 200 +process_material = SubResource("ParticleProcessMaterial_pslfe") +one_shot = true +explosiveness = 1.0 diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..92223f9 --- /dev/null +++ b/project.godot @@ -0,0 +1,46 @@ +config_version=5 + +[application] + +config/name="UFO with a Gravity Gun" +run/main_scene="res://node_2d.tscn" +config/features=PackedStringArray("4.2", "Mobile") +config/icon="res://UFO.png" +config/tags=PackedStringArray("finished", "prototype") + +[display] + +window/size/viewport_width=1280 +window/size/viewport_height=720 +window/size/mode=3 +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" +mouse_cursor/custom_image="res://cursor.png" + +[input] + +up={ +"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":87,"key_label":0,"unicode":119,"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) +] +} +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) +] +} +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) +] +} + +[rendering] + +renderer/rendering_method="gl_compatibility" +environment/defaults/default_clear_color=Color(0, 0, 0.0666667, 1) |