diff --git a/Prefabs/lander.tscn b/Prefabs/lander.tscn index 8b5752f..04e260c 100644 --- a/Prefabs/lander.tscn +++ b/Prefabs/lander.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://crrbht7mwhgyc"] +[gd_scene load_steps=6 format=3 uid="uid://crrbht7mwhgyc"] [ext_resource type="Script" uid="uid://cd54ktlkabbla" path="res://ship.gd" id="1_do8h0"] [ext_resource type="Texture2D" uid="uid://bd5oswedqnenh" path="res://Sprites/LanderArt.png" id="2_do8h0"] @@ -10,6 +10,9 @@ size = Vector2(8, 2) offsets = PackedFloat32Array(0, 0.0886699, 1) colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0) +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_do8h0"] +height = 32.0 + [node name="Lander" type="RigidBody2D" node_paths=PackedStringArray("particles_l", "particles_r")] gravity_scale = 0.2 script = ExtResource("1_do8h0") @@ -56,3 +59,8 @@ damping_max = 60.8 scale_amount_min = 6.0 scale_amount_max = 6.0 color_ramp = SubResource("Gradient_do8h0") + +[node name="CollisionShape2D3" type="CollisionShape2D" parent="."] +position = Vector2(0, -3) +rotation = -1.57079 +shape = SubResource("CapsuleShape2D_do8h0") diff --git a/Prefabs/spare_battery.tscn b/Prefabs/spare_battery.tscn index 6c7721e..b17743a 100644 --- a/Prefabs/spare_battery.tscn +++ b/Prefabs/spare_battery.tscn @@ -1,12 +1,13 @@ [gd_scene load_steps=3 format=3 uid="uid://cfdsa5scvso6m"] [ext_resource type="Texture2D" uid="uid://1uqioi3jaw62" path="res://Sprites/batteryOutline.png" id="1_extsq"] -[ext_resource type="Texture2D" uid="uid://1gx13iy21l2a" path="res://Sprites/batteryfull.png" id="2_n31ms"] +[ext_resource type="Texture2D" uid="uid://wkhhifawnhew" path="res://Sprites/fullAlt.png" id="2_extsq"] [node name="Battery2" type="TextureProgressBar"] max_value = 16.0 +step = 0.0 value = 16.0 fill_mode = 3 texture_under = ExtResource("1_extsq") -texture_progress = ExtResource("2_n31ms") +texture_progress = ExtResource("2_extsq") tint_progress = Color(0, 1, 0, 1) diff --git a/Sprites/fullAlt.png b/Sprites/fullAlt.png new file mode 100644 index 0000000..d94f627 Binary files /dev/null and b/Sprites/fullAlt.png differ diff --git a/Sprites/fullAlt.png.import b/Sprites/fullAlt.png.import new file mode 100644 index 0000000..2765159 --- /dev/null +++ b/Sprites/fullAlt.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://wkhhifawnhew" +path="res://.godot/imported/fullAlt.png-b65fa558e3aa10a8bd4bf9b7c8a58678.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/fullAlt.png" +dest_files=["res://.godot/imported/fullAlt.png-b65fa558e3aa10a8bd4bf9b7c8a58678.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/autoscroll.gd b/autoscroll.gd index 7093990..216a18d 100644 --- a/autoscroll.gd +++ b/autoscroll.gd @@ -1,6 +1,7 @@ extends Camera2D @export var camera_speed : float = 10 +var current_speed : float = 0 var active : bool = false # Called when the node enters the scene tree for the first time. @@ -11,7 +12,8 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: if active: - position.x += delta * camera_speed + current_speed = clampf(current_speed + 10* delta,0,camera_speed) + position.x += delta * current_speed func _on_lander_moved() -> void: diff --git a/game.tscn b/game.tscn index c3c2a98..bae4db0 100644 --- a/game.tscn +++ b/game.tscn @@ -1,11 +1,9 @@ -[gd_scene load_steps=14 format=3 uid="uid://hv07lm2tjwn4"] +[gd_scene load_steps=12 format=3 uid="uid://hv07lm2tjwn4"] [ext_resource type="PackedScene" uid="uid://crrbht7mwhgyc" path="res://Prefabs/lander.tscn" id="1_80nbo"] [ext_resource type="Script" uid="uid://bltj2frs6vqwj" path="res://autoscroll.gd" id="1_feb5d"] [ext_resource type="Script" uid="uid://mwbiu2ajbxlk" path="res://battery_manager.gd" id="1_ryrav"] [ext_resource type="Texture2D" uid="uid://evhjxwdbsmlo" path="res://Sprites/start.png" id="2_e2o6t"] -[ext_resource type="Texture2D" uid="uid://1uqioi3jaw62" path="res://Sprites/batteryOutline.png" id="2_eow3j"] -[ext_resource type="Texture2D" uid="uid://1gx13iy21l2a" path="res://Sprites/batteryfull.png" id="3_j5wjh"] [ext_resource type="PackedScene" uid="uid://cfdsa5scvso6m" path="res://Prefabs/spare_battery.tscn" id="4_eow3j"] [ext_resource type="Script" uid="uid://dd8psfqfobgau" path="res://test_obstacle_spawner.gd" id="6_vef74"] [ext_resource type="PackedScene" uid="uid://jb677rdhbj83" path="res://Prefabs/obstacle.tscn" id="8_j5wjh"] @@ -54,28 +52,16 @@ layout_mode = 1 offset_right = 68.0 offset_bottom = 32.0 script = ExtResource("1_ryrav") -current_battery = NodePath("Battery") +current_battery = NodePath("Battery4") -[node name="Battery" type="TextureProgressBar" parent="CanvasLayer/UI/BatteryHolder"] +[node name="Battery4" parent="CanvasLayer/UI/BatteryHolder" instance=ExtResource("4_eow3j")] layout_mode = 2 -max_value = 16.0 -value = 16.0 -fill_mode = 3 -texture_under = ExtResource("2_eow3j") -texture_progress = ExtResource("3_j5wjh") -tint_progress = Color(0, 1, 0, 1) [node name="Battery2" parent="CanvasLayer/UI/BatteryHolder" instance=ExtResource("4_eow3j")] layout_mode = 2 -[node name="Battery3" type="TextureProgressBar" parent="CanvasLayer/UI/BatteryHolder"] +[node name="Battery3" parent="CanvasLayer/UI/BatteryHolder" instance=ExtResource("4_eow3j")] layout_mode = 2 -max_value = 16.0 -value = 16.0 -fill_mode = 3 -texture_under = ExtResource("2_eow3j") -texture_progress = ExtResource("3_j5wjh") -tint_progress = Color(0, 1, 0, 1) [node name="Camera2D" type="Camera2D" parent="."] anchor_mode = 0