Compare commits
3 commits
dd0aef3469
...
9134c32d2c
| Author | SHA1 | Date | |
|---|---|---|---|
| 9134c32d2c | |||
| 0257dc0770 | |||
| c19f0f5a3b |
17 changed files with 83 additions and 64 deletions
|
|
@ -14,9 +14,19 @@ func _ready() -> void:
|
|||
|
||||
grid.buildings.append(self)
|
||||
|
||||
await get_tree().create_timer(0).timeout
|
||||
if get_node_or_null("EnemyList") != null:
|
||||
for enemy in $EnemyList.get_children():
|
||||
enemy.reparent(get_parent())
|
||||
var oldpos = enemy.position;
|
||||
enemy.reparent(get_tree().get_root())
|
||||
enemy.position = get_world_position(oldpos)
|
||||
if(enemy.has_method("init_at_horizontal_distortion")):
|
||||
enemy.init_at_horizontal_distortion(enemy.position.length() / grid.ground_radius)
|
||||
|
||||
func get_world_position (local_position: Vector2) -> Vector2:
|
||||
var height = grid.ground_radius + location.y * grid.cell_height - local_position.y
|
||||
var angle = (location.x + local_position.x / grid.cell_height) * TAU / grid.num_collumns
|
||||
return height * Vector2.from_angle(angle)
|
||||
|
||||
func overlaps(other : Building):
|
||||
# heights don't overlap
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://djawvtdwp423v"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://djawvtdwp423v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_5j34s"]
|
||||
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_xx8ra"]
|
||||
|
|
@ -6,6 +6,8 @@
|
|||
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_xr4t5"]
|
||||
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_pfkkr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="5_xr4t5"]
|
||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="7_35wcg"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="8_sifiv"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
|
||||
shader = ExtResource("2_xx8ra")
|
||||
|
|
@ -32,3 +34,33 @@ grid_offset = Vector2i(0, -1)
|
|||
[node name="EnemyList" type="Node2D" parent="."]
|
||||
|
||||
[node name="MorningStar" parent="EnemyList" instance=ExtResource("5_xr4t5")]
|
||||
position = Vector2(397, -3)
|
||||
|
||||
[node name="Ghost" parent="EnemyList" instance=ExtResource("7_35wcg")]
|
||||
position = Vector2(118, -125)
|
||||
|
||||
[node name="Platform" parent="EnemyList" instance=ExtResource("8_sifiv")]
|
||||
visible = false
|
||||
position = Vector2(75, -285)
|
||||
|
||||
[node name="Platform2" parent="EnemyList" instance=ExtResource("8_sifiv")]
|
||||
visible = false
|
||||
position = Vector2(225, -285)
|
||||
|
||||
[node name="Platform3" parent="EnemyList" instance=ExtResource("8_sifiv")]
|
||||
visible = false
|
||||
position = Vector2(375, -285)
|
||||
|
||||
[node name="Platform4" parent="EnemyList" instance=ExtResource("8_sifiv")]
|
||||
visible = false
|
||||
position = Vector2(525, -285)
|
||||
|
||||
[node name="Platform5" parent="EnemyList" instance=ExtResource("8_sifiv")]
|
||||
position = Vector2(300, -150)
|
||||
scale = Vector2(2.688, 3)
|
||||
|
||||
[node name="DebugSprite" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(300, -150)
|
||||
scale = Vector2(1.172, 1.172)
|
||||
texture = ExtResource("3_xr4t5")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://cmofmd0vf3hx3"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cmofmd0vf3hx3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_q3nfb"]
|
||||
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_uv7v8"]
|
||||
[ext_resource type="Texture2D" uid="uid://djir4ehm8kif" path="res://buildings/Building 1x2 fixed.png" id="3_uv7v8"]
|
||||
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_bl5jt"]
|
||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="5_23fi7"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="6_e6j05"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
|
||||
resource_local_to_scene = true
|
||||
|
|
@ -27,4 +28,24 @@ script = ExtResource("4_bl5jt")
|
|||
[node name="EnemyList" type="Node2D" parent="."]
|
||||
|
||||
[node name="Ghost" parent="EnemyList" instance=ExtResource("5_23fi7")]
|
||||
position = Vector2(115, -75)
|
||||
position = Vector2(150, -300)
|
||||
|
||||
[node name="Platform" parent="EnemyList" instance=ExtResource("6_e6j05")]
|
||||
visible = false
|
||||
position = Vector2(75, -585)
|
||||
|
||||
[node name="Platform2" parent="EnemyList" instance=ExtResource("6_e6j05")]
|
||||
visible = false
|
||||
position = Vector2(225, -585)
|
||||
|
||||
[node name="Platform3" parent="EnemyList" instance=ExtResource("6_e6j05")]
|
||||
position = Vector2(290, -431)
|
||||
|
||||
[node name="Platform4" parent="EnemyList" instance=ExtResource("6_e6j05")]
|
||||
position = Vector2(62, -184)
|
||||
|
||||
[node name="DebugSprite" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(150, -300)
|
||||
scale = Vector2(1.172, 1.172)
|
||||
texture = ExtResource("3_uv7v8")
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ func _physics_process(delta: float) -> void:
|
|||
var motion = -(position - target.position).normalized() * speed
|
||||
self.position += motion * delta * min(1, dist/(motion.length()*delta))
|
||||
|
||||
|
||||
self.position += earth_aligner.global_from_local(current_knockback) * delta
|
||||
current_knockback = current_knockback/pow(1.3, 60*delta)
|
||||
|
||||
|
|
|
|||
20
main.tscn
20
main.tscn
|
|
@ -1,14 +1,11 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://cxo6bq26huau7"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cxo6bq26huau7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
||||
[ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="2_lquwl"]
|
||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="3_h2yge"]
|
||||
[ext_resource type="PackedScene" uid="uid://jjoyj1ldafkf" path="res://world/earth.tscn" id="3_lquwl"]
|
||||
[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="4_1bvp3"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="4_5vw27"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpdn2php3ydsv" path="res://death_screen/death_screen.tscn" id="7_5vw27"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="7_272bh"]
|
||||
|
||||
[node name="main" type="Node2D"]
|
||||
|
||||
|
|
@ -16,12 +13,6 @@
|
|||
unique_name_in_owner = true
|
||||
script = ExtResource("2_lquwl")
|
||||
|
||||
[node name="Ghost" parent="." instance=ExtResource("3_h2yge")]
|
||||
position = Vector2(0, -3200)
|
||||
|
||||
[node name="Platform" parent="." instance=ExtResource("4_5vw27")]
|
||||
position = Vector2(934, -2965)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_1bvp3")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(500, -3100)
|
||||
|
|
@ -32,14 +23,14 @@ position = Vector2(0, -50)
|
|||
ignore_rotation = false
|
||||
|
||||
[node name="Debug_Camera" type="Camera2D" parent="."]
|
||||
scale = Vector2(41.020004, 41.020004)
|
||||
zoom = Vector2(0.15, 0.15)
|
||||
scale = Vector2(41.02, 41.02)
|
||||
zoom = Vector2(0.12, 0.12)
|
||||
|
||||
[node name="Building Generator" type="Node" parent="."]
|
||||
script = ExtResource("4_1bvp3")
|
||||
|
||||
[node name="Timer" type="Timer" parent="Building Generator"]
|
||||
wait_time = 0.5
|
||||
wait_time = 5.0
|
||||
autostart = true
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
|
@ -51,9 +42,6 @@ offset_bottom = 128.0
|
|||
[node name="DeathScreen" parent="CanvasLayer" instance=ExtResource("7_5vw27")]
|
||||
visible = false
|
||||
|
||||
[node name="MorningStar" parent="." instance=ExtResource("7_272bh")]
|
||||
position = Vector2(989, -2939)
|
||||
|
||||
[connection signal="health_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_health_changed"]
|
||||
[connection signal="player_died" from="Player" to="CanvasLayer/DeathScreen" method="_on_player_player_died"]
|
||||
[connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"]
|
||||
|
|
|
|||
4
platform.gd
Normal file
4
platform.gd
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
extends StaticBody2D
|
||||
|
||||
func init_at_horizontal_distortion(distortion : float):
|
||||
scale.x *= distortion
|
||||
1
platform.gd.uid
Normal file
1
platform.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dwmquoam37sve
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://4l3elvxpghw8"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://4l3elvxpghw8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dwmquoam37sve" path="res://platform.gd" id="1_c1gtx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_s8bxr"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="2_c1gtx"]
|
||||
|
||||
|
|
@ -7,7 +8,8 @@
|
|||
size = Vector2(56, 6)
|
||||
|
||||
[node name="Platform" type="StaticBody2D"]
|
||||
scale = Vector2(3, 3)
|
||||
scale = Vector2(2.778, 3.1)
|
||||
script = ExtResource("1_c1gtx")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_ry5bi")
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 1.png-47c623e9d3540b4a00d2bddf52ae0b2a.c
|
|||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
|
|
@ -27,10 +25,6 @@ mipmaps/generate=false
|
|||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 2.png-5dea4fdec55fa43e26680e08090fd654.c
|
|||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
|
|
@ -27,10 +25,6 @@ mipmaps/generate=false
|
|||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 3.png-27890c0cb512383b8ecbd848c73efee1.c
|
|||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
|
|
@ -27,10 +25,6 @@ mipmaps/generate=false
|
|||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 4.png-232b1eae2acf3ad82130431014262cde.c
|
|||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
|
|
@ -27,10 +25,6 @@ mipmaps/generate=false
|
|||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 5.png-cfb8eb15ace876127c083283fe74cdc0.c
|
|||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
|
|
@ -27,10 +25,6 @@ mipmaps/generate=false
|
|||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 6.png-f243f98e182be67eb8681a11d34ee554.c
|
|||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
|
|
@ -27,10 +25,6 @@ mipmaps/generate=false
|
|||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ config_version=5
|
|||
|
||||
config/name="The Dark Side of Earth"
|
||||
run/main_scene="uid://cxo6bq26huau7"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
|
|
|||
|
|
@ -21,13 +21,9 @@ radius = 3000.0
|
|||
|
||||
[node name="Grid" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(1, 0)
|
||||
script = ExtResource("3_2bhor")
|
||||
ground_radius = 3000.0
|
||||
cell_height = 300.0
|
||||
num_collumns = 60
|
||||
packed_buildings = Array[PackedScene]([ExtResource("3_nihcy"), ExtResource("4_ml5no")])
|
||||
metadata/_custom_type_script = "uid://m3vyyfk8gnma"
|
||||
|
||||
[node name="Building" parent="Grid" instance=ExtResource("3_nihcy")]
|
||||
location = Vector2i(45, 1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue