diff --git a/.DS_Store b/.DS_Store index 41a6cab..71b1ae1 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 4709183..4fda5b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Godot 4+ specific ignores .godot/ +Build/ diff --git a/Flow State.wav b/Flow State.wav new file mode 100644 index 0000000..9db42a7 Binary files /dev/null and b/Flow State.wav differ diff --git a/Flow State.wav.import b/Flow State.wav.import new file mode 100644 index 0000000..2d6dc9b --- /dev/null +++ b/Flow State.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://d3icnl4vjbbt7" +path="res://.godot/imported/Flow State.wav-724bf1be86d97bd6a743676d78bb1bd5.sample" + +[deps] + +source_file="res://Flow State.wav" +dest_files=["res://.godot/imported/Flow State.wav-724bf1be86d97bd6a743676d78bb1bd5.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Settings.gd b/Settings.gd index d5594a9..5b1b030 100644 --- a/Settings.gd +++ b/Settings.gd @@ -11,6 +11,7 @@ func _ready(): if has_config: $Menu/Username.text = config.get_value("config", "username") $Menu/Controls.selected = 0 if config.get_value("config", "relative_controls") else 1 + $Menu/Character.selected = CHARACTERS.find(config.get_value("gameplay", "class")) func _process(delta): check_valid("") diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..49bdc6e --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +godot --headless --export-release Web Build/index.html diff --git a/godot b/godot new file mode 100755 index 0000000..e6d9dc1 Binary files /dev/null and b/godot differ diff --git a/main.tscn b/main.tscn index d4bf5f6..881b11f 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=110 format=3 uid="uid://bmd4m7lqj4v0x"] +[gd_scene load_steps=111 format=3 uid="uid://bmd4m7lqj4v0x"] [ext_resource type="Script" path="res://main.gd" id="1_3dydx"] [ext_resource type="Script" path="res://Spawner.gd" id="1_ifu8g"] @@ -20,6 +20,7 @@ [ext_resource type="Script" path="res://Stopwatch.gd" id="13_xhnp2"] [ext_resource type="Script" path="res://Leaderboard.gd" id="14_v1elq"] [ext_resource type="PackedScene" uid="uid://4sdwatj6up8i" path="res://tar.tscn" id="19_8258f"] +[ext_resource type="AudioStream" uid="uid://d3icnl4vjbbt7" path="res://Flow State.wav" id="21_7tjgd"] [sub_resource type="Resource" id="Resource_ur7l5"] script = ExtResource("4_um0x7") @@ -886,6 +887,10 @@ script = ExtResource("13_lkv81") process_mode = 3 script = ExtResource("1_k8sg3") +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("21_7tjgd") +autoplay = true + [connection signal="wave_complete" from="Spawner" to="UI/Stopwatch" method="wave_finished"] [connection signal="timeout" from="Spawner/Timer" to="Spawner" method="check_enemies_loop"] [connection signal="visibility_changed" from="GameOver/Leaderboard" to="GameOver/Leaderboard" method="submit_score"] diff --git a/player-apezoid.gd b/player-apezoid.gd index 7307a29..62026ff 100644 --- a/player-apezoid.gd +++ b/player-apezoid.gd @@ -1,11 +1,18 @@ extends "res://player.gd" var can_damage = false +var shooting = false var idle_texture = preload("res://dotted line.png") var aiming_texture = preload("res://laser_idle.png") var active_texture = preload("res://ircle_laser.gif") +func _ready(): + update_animation() + if config.load("user://settings.cfg") == OK: + absolute_movement = not config.get_value("config", "relative_controls") + speed = 750 + func update_animation(): if moving: $Engine.play("active") @@ -13,7 +20,7 @@ func update_animation(): $Engine.play("idle") func _input(event): - if event.is_action_pressed("shoot"): + if event.is_action_pressed("shoot") and speed != 0: $Laser.fire() fire_laser() @@ -21,37 +28,35 @@ func _process(delta): if can_damage: var body = $Laser/RayCast2D.get_collider() - if body != null and body.is_in_group("destructible"): + if body != null and (body.is_in_group("destructible") or body.name == "Entagon"): if body.has_method("destroy"): body.destroy() else: body.queue_free() - can_damage = false func fire_laser(): var tween = get_tree().create_tween() - frozen = true + speed = 0 $Body.play("shoot") tween.set_parallel(true) tween.tween_callback(set_laser_texture.bind(aiming_texture)) tween.tween_property($Laser, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_IN) tween.tween_callback(play_with_delay) tween.set_parallel(false) - tween.tween_callback(can_shoot.bind(true)) tween.tween_callback(set_laser_texture.bind(active_texture)) tween.tween_callback($Laser.fire) + tween.tween_property(self, "can_damage", true, 0) tween.tween_interval(0.2) - tween.tween_callback(can_shoot.bind(false)) + tween.tween_property(self, "can_damage", false, 0) tween.tween_callback(set_laser_texture.bind(aiming_texture)) tween.set_parallel(true) tween.tween_property($Laser, "modulate", Color(Color.WHITE, 0.2), 0.2).set_ease(Tween.EASE_OUT) tween.set_parallel(false) tween.tween_callback(set_laser_texture.bind(idle_texture)) tween.tween_callback($Body.play.bind("idle")) - tween.tween_property(self, "frozen", false, 0) + tween.tween_property(self, "speed", 750, 0) -func can_shoot(yn): - can_damage = yn + func play_with_delay(): await get_tree().create_timer(0.9).timeout diff --git a/player-apezoid.tscn b/player-apezoid.tscn index 1f34d33..e7c0b06 100644 --- a/player-apezoid.tscn +++ b/player-apezoid.tscn @@ -162,6 +162,7 @@ radius = 14.0 height = 40.0 [node name="Player" instance=ExtResource("1_4dgnt")] +scale = Vector2(2, 2) lock_rotation = true script = ExtResource("2_axxxt")