Ceiling Platforms for the two buildings + some room layout
This commit is contained in:
parent
c19f0f5a3b
commit
0257dc0770
8 changed files with 62 additions and 26 deletions
|
|
@ -20,7 +20,9 @@ func _ready() -> void:
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=9 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"]
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
[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")
|
||||
|
|
@ -38,6 +39,26 @@ 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)
|
||||
|
|
|
|||
|
|
@ -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(150, 300)
|
||||
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")
|
||||
|
|
|
|||
22
main.tscn
22
main.tscn
|
|
@ -1,14 +1,11 @@
|
|||
[gd_scene load_steps=10 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,16 +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="Debug_Camera" type="Camera2D" parent="."]
|
||||
scale = Vector2(41.02, 41.02)
|
||||
zoom = Vector2(0.15, 0.15)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_1bvp3")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(500, -3100)
|
||||
|
|
@ -35,6 +22,10 @@ scale = Vector2(3, 3)
|
|||
position = Vector2(0, -50)
|
||||
ignore_rotation = false
|
||||
|
||||
[node name="Debug_Camera" type="Camera2D" parent="."]
|
||||
scale = Vector2(41.02, 41.02)
|
||||
zoom = Vector2(0.12, 0.12)
|
||||
|
||||
[node name="Building Generator" type="Node" parent="."]
|
||||
script = ExtResource("4_1bvp3")
|
||||
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -27,6 +27,3 @@ 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, 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue