we're so close to working multiplayer

This commit is contained in:
2023-11-16 00:07:41 +11:00
parent 1500c22ccc
commit 2d123bd731
81 changed files with 578 additions and 388 deletions

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=12 format=3 uid="uid://bjo2q6vca5qlv"]
[gd_scene load_steps=13 format=3 uid="uid://bjo2q6vca5qlv"]
[ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_m83kr"]
[ext_resource type="Gradient" uid="uid://dx7auy3oqw82t" path="res://health_bar_gradient.tres" id="2_ql1oc"]
[ext_resource type="Script" path="res://Scripts/health.gd" id="3_wiose"]
[ext_resource type="PackedScene" uid="uid://cqtew0t8sttpm" path="res://Scenes/damage_particle.tscn" id="4_mhq3m"]
[ext_resource type="Script" path="res://Scripts/hitbox.gd" id="5_433ie"]
@ -24,6 +25,7 @@ status_manager = NodePath("StatusEffector")
movement_controller = NodePath("BeeliningController")
health = NodePath("Health")
sprite = NodePath("DirectionSprite")
health_bar_gradient = ExtResource("2_ql1oc")
[node name="Health" type="Node" parent="."]
script = ExtResource("3_wiose")
@ -42,6 +44,7 @@ texture = ExtResource("6_ke2c8")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 1.15918, 0)
sorting_offset = 1.0
pixel_size = 0.02
billboard = 1
texture_filter = 0

View File

@ -12,6 +12,6 @@ icon = ExtResource("1_lck53")
sprite = ExtResource("2_7nc4x")
spawn_power = 14
health = 350
penalty = 10
penalty = 15
movement_speed = 0.8
spawn_cooldown = 2.0

View File

@ -9,6 +9,7 @@ signal died(enemy)
@export var movement_controller : EnemyMovement
@export var health : Health
@export var sprite : Sprite3D
@export var health_bar_gradient : Gradient
var movement_speed
var movement_speed_penalty := 1.0
@ -45,5 +46,5 @@ func die():
func _on_health_health_changed(value) -> void:
$SubViewport/ProgressBar.value = value
var percent = float(health.current_health) / float(health.max_health)
$SubViewport/ProgressBar.tint_progress = Color(1 - percent, percent, 0.0)
$SubViewport/ProgressBar.tint_progress = health_bar_gradient.sample(percent)
$SubViewport/ProgressBar.set_visible(true)

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=14 format=3 uid="uid://b0nady5xm88bo"]
[gd_scene load_steps=15 format=3 uid="uid://b0nady5xm88bo"]
[ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_fwsjt"]
[ext_resource type="Script" path="res://Scripts/hitbox.gd" id="2_j8yin"]
[ext_resource type="Gradient" uid="uid://dx7auy3oqw82t" path="res://health_bar_gradient.tres" id="2_jn5to"]
[ext_resource type="PackedScene" uid="uid://ri8r03wqy80t" path="res://Scenes/8_direction_sprite.tscn" id="2_o7jmg"]
[ext_resource type="Script" path="res://Scripts/health.gd" id="2_swu53"]
[ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="3_naknq"]
@ -13,7 +14,7 @@
[sub_resource type="SphereShape3D" id="SphereShape3D_21dgw"]
[sub_resource type="AtlasTexture" id="AtlasTexture_sn7du"]
[sub_resource type="AtlasTexture" id="AtlasTexture_s4568"]
resource_local_to_scene = true
atlas = ExtResource("3_naknq")
region = Rect2(0, 0, 32, 32)
@ -29,6 +30,7 @@ status_manager = NodePath("StatusEffector")
movement_controller = NodePath("PathingController")
health = NodePath("Health")
sprite = NodePath("DirectionSprite")
health_bar_gradient = ExtResource("2_jn5to")
[node name="Health" type="Node" parent="."]
script = ExtResource("2_swu53")
@ -42,10 +44,11 @@ script = ExtResource("2_j8yin")
[node name="DirectionSprite" parent="." instance=ExtResource("2_o7jmg")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.642479, 0)
pixel_size = 0.04
texture = SubResource("AtlasTexture_sn7du")
texture = SubResource("AtlasTexture_s4568")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 1.20821, 0)
sorting_offset = 1.0
pixel_size = 0.02
billboard = 1
texture_filter = 0