This commit is contained in:
Ione 15 2024-03-30 21:30:10 +01:00
parent 82437bc8b8
commit a0af15ea45
5 changed files with 41 additions and 13 deletions

16
Scenes/Items/root_item.gd Normal file
View File

@ -0,0 +1,16 @@
extends Area2D
var rot_speed: int = 360
var type = ['laser','grenade','health']
var sel = type[randi()%len(type)]
func _ready():
if sel == 'laser':
$Sprite2D.modulate = Color(0,0,1)
if sel == 'grenade':
$Sprite2D.modulate = Color(1,0,0)
if sel == 'health':
$Sprite2D.modulate = Color(0,1,0)
func _process(delta):
rotation_degrees += rot_speed * delta

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://kfxhc6eq6axw"]
[gd_scene load_steps=5 format=3 uid="uid://kfxhc6eq6axw"]
[ext_resource type="Texture2D" uid="uid://bkiighjuu156o" path="res://graphics/items/orb2.png" id="1_8spff"]
[ext_resource type="Script" path="res://Scenes/Items/root_item.gd" id="1_xoi2c"]
[ext_resource type="Texture2D" uid="uid://dyooog1cujiia" path="res://graphics/lights/textures/circle.png" id="2_vccha"]
[sub_resource type="CircleShape2D" id="CircleShape2D_jy2ov"]
@ -8,6 +9,7 @@ radius = 54.0833
[node name="RootItem" type="Area2D"]
collision_layer = 16
script = ExtResource("1_xoi2c")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_jy2ov")
@ -16,6 +18,6 @@ shape = SubResource("CircleShape2D_jy2ov")
texture = ExtResource("1_8spff")
[node name="PointLight2D" type="PointLight2D" parent="."]
scale = Vector2(0.2, 0.2)
energy = 2.0
scale = Vector2(0.1, 0.1)
energy = 0.75
texture = ExtResource("2_vccha")

View File

@ -25,12 +25,12 @@ func _on_player_grenade(pos, direction):
$Projectiles.add_child(grenade)
$UI.update_grenade_text()
func _on_house_player_entered_house():
var tween = get_tree().create_tween()
tween.tween_property($Player/Camera2D, "zoom", Vector2(0.8,0.8), 2)
func _on_house_player_exited_house():
var tween = get_tree().create_tween()
tween.tween_property($Player/Camera2D, "zoom", Vector2(0.5,0.5), 2)
#
#func _on_house_player_entered_house():
# var tween = get_tree().create_tween()
# tween.tween_property($Player/Camera2D, "zoom", Vector2(0.8,0.8), 2)
#
#
#func _on_house_player_exited_house():
# var tween = get_tree().create_tween()
# tween.tween_property($Player/Camera2D, "zoom", Vector2(0.5,0.5), 2)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://ct2v4vry6y7ty"]
[gd_scene load_steps=20 format=3 uid="uid://ct2v4vry6y7ty"]
[ext_resource type="PackedScene" uid="uid://dbvpleho4gwrl" path="res://Scenes/Level/level.tscn" id="1_wga7w"]
[ext_resource type="PackedScene" uid="uid://dci80b688lufk" path="res://Scenes/Objects/gate.tscn" id="2_exphv"]
@ -15,6 +15,7 @@
[ext_resource type="PackedScene" uid="uid://gaojaq3rryyp" path="res://Scenes/House/house.tscn" id="12_rwft6"]
[ext_resource type="PackedScene" uid="uid://dmnemcyjt8408" path="res://Scenes/Animations/light_fan_animation.tscn" id="13_atice"]
[ext_resource type="PackedScene" uid="uid://kfxhc6eq6axw" path="res://Scenes/Items/root_item.tscn" id="15_ts1r7"]
[ext_resource type="PackedScene" uid="uid://c058jswuy7r6b" path="res://Scenes/Objects/steam_vent.tscn" id="16_wt6ys"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ddns6"]
resource_name = "Walls"
@ -181,4 +182,7 @@ position = Vector2(-51, 2025)
[node name="RootItem" parent="." index="7" instance=ExtResource("15_ts1r7")]
position = Vector2(1072, 490)
[node name="SteamVent" parent="." index="8" instance=ExtResource("16_wt6ys")]
position = Vector2(841, 980)
[connection signal="player_entered_gate" from="Gate" to="." method="_on_gate_player_entered_gate"]

View File

@ -25,5 +25,11 @@ shape = SubResource("CapsuleShape2D_1bk2r")
wait_time = 10.0
one_shot = true
[node name="PointLight2D" type="PointLight2D" parent="."]
position = Vector2(0, -79)
energy = 10.0
texture = ExtResource("1_amywq")
texture_scale = 1.1
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]