Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth
This commit is contained in:
commit
58bed67228
11 changed files with 172 additions and 3 deletions
26
blob.gd
Normal file
26
blob.gd
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
extends Node2D
|
||||
|
||||
|
||||
var moving = false
|
||||
@onready var player = get_tree().get_root().get_node("main/Player")
|
||||
@onready var target = player.position
|
||||
var speed = 500
|
||||
|
||||
var reached = false
|
||||
signal target_reached
|
||||
|
||||
func _ready() -> void:
|
||||
await get_tree().create_timer(1).timeout
|
||||
moving = true
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if moving:
|
||||
position += (target - global_position).normalized().rotated(-get_parent().rotation) * speed * delta
|
||||
if((global_position - target).length() < 40):
|
||||
moving = false
|
||||
if not reached:
|
||||
target_reached.emit()
|
||||
reached = true
|
||||
if has_node("Area2D") and $Area2D.overlaps_body(player):
|
||||
player.hurt(1, global_position-player.position)
|
||||
|
||||
1
blob.gd.uid
Normal file
1
blob.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d4n32kt7t726k
|
||||
32
blob_big.gd
Normal file
32
blob_big.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
extends Node2D
|
||||
@onready var player = get_tree().get_root().get_node("main/Player")
|
||||
var speed = 200
|
||||
var angular_speed = TAU/8
|
||||
var lifetime = 5
|
||||
|
||||
var ready_blobs = 0
|
||||
var num_blobs = 4
|
||||
|
||||
var particles_ended = false
|
||||
|
||||
func _on_target_reached():
|
||||
ready_blobs += 1
|
||||
|
||||
func _ready() -> void:
|
||||
for child in get_children():
|
||||
if "target_reached" in child:
|
||||
child.connect("target_reached", _on_target_reached)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if ready_blobs == num_blobs:
|
||||
position += (player.position - position).normalized() * speed * delta
|
||||
rotate(angular_speed * delta)
|
||||
lifetime -= delta
|
||||
if lifetime < 0 and not particles_ended:
|
||||
particles_ended = true
|
||||
for child in get_children():
|
||||
if "target_reached" in child:
|
||||
child.get_node("GPUParticles2D").emitting = false
|
||||
child.get_node("Area2D").queue_free()
|
||||
if lifetime < -2:
|
||||
queue_free()
|
||||
1
blob_big.gd.uid
Normal file
1
blob_big.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b22hbgn80m4l0
|
||||
19
blob_big.tscn
Normal file
19
blob_big.tscn
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bg2hgia0jqnqf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b22hbgn80m4l0" path="res://blob_big.gd" id="1_xkk63"]
|
||||
[ext_resource type="PackedScene" uid="uid://ck0bj7444wfsl" path="res://blob_small.tscn" id="2_jl75s"]
|
||||
|
||||
[node name="blob_big" type="Node2D"]
|
||||
script = ExtResource("1_xkk63")
|
||||
|
||||
[node name="Blob" parent="." instance=ExtResource("2_jl75s")]
|
||||
position = Vector2(400, 0)
|
||||
|
||||
[node name="Blob2" parent="." instance=ExtResource("2_jl75s")]
|
||||
position = Vector2(-400, 0)
|
||||
|
||||
[node name="Blob3" parent="." instance=ExtResource("2_jl75s")]
|
||||
position = Vector2(0, -400)
|
||||
|
||||
[node name="Blob4" parent="." instance=ExtResource("2_jl75s")]
|
||||
position = Vector2(0, 400)
|
||||
37
blob_small.tscn
Normal file
37
blob_small.tscn
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://ck0bj7444wfsl"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d4n32kt7t726k" path="res://blob.gd" id="1_wigkh"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvlvu37up72gt" path="res://bubble.png" id="2_jle3w"]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_aaw6g"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 53.96
|
||||
angular_velocity_min = -1.60933e-05
|
||||
angular_velocity_max = -1.60933e-05
|
||||
orbit_velocity_min = 0.184
|
||||
orbit_velocity_max = 0.184
|
||||
radial_velocity_min = 91.95
|
||||
radial_velocity_max = 160.92
|
||||
gravity = Vector3(0, 0, 0)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_i5m1y"]
|
||||
radius = 45.0
|
||||
|
||||
[node name="Blob" type="Node2D"]
|
||||
script = ExtResource("1_wigkh")
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
amount = 100
|
||||
texture = ExtResource("2_jle3w")
|
||||
lifetime = 0.1
|
||||
speed_scale = 0.3
|
||||
fixed_fps = 60
|
||||
process_material = SubResource("ParticleProcessMaterial_aaw6g")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("CircleShape2D_i5m1y")
|
||||
7
boss.gd
7
boss.gd
|
|
@ -3,6 +3,7 @@ extends CharacterBody2D
|
|||
@onready var player = get_tree().get_root().get_node("main/Player")
|
||||
var moves = ["slam", "wave", "water_rise", "splash"]
|
||||
@onready var next_move = choose_next_move()
|
||||
@export var big_blob : PackedScene
|
||||
|
||||
var risen = 0
|
||||
var attack_ready = true
|
||||
|
|
@ -80,5 +81,9 @@ func water_rise():
|
|||
attack_ready = true
|
||||
|
||||
func splash():
|
||||
await get_tree().create_timer(4).timeout
|
||||
var blob_instance = big_blob.instantiate()
|
||||
get_tree().get_root().add_child(blob_instance)
|
||||
blob_instance.position = player.position
|
||||
blob_instance.rotation = randf_range(0, TAU)
|
||||
await get_tree().create_timer(5).timeout
|
||||
attack_ready = true
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://cpe4s6vsn0ujd"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cpe4s6vsn0ujd"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost animation/Ghost 1.png" id="1_6xxrv"]
|
||||
[ext_resource type="Script" uid="uid://uv672p8f4n6k" path="res://boss.gd" id="1_skx2t"]
|
||||
[ext_resource type="PackedScene" uid="uid://bg2hgia0jqnqf" path="res://blob_big.tscn" id="2_o1i15"]
|
||||
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_skx2t"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="4_lnbgr"]
|
||||
|
||||
|
|
@ -13,6 +14,7 @@ size = Vector2(300, 250)
|
|||
[node name="Boss" type="CharacterBody2D"]
|
||||
collision_mask = 32
|
||||
script = ExtResource("1_skx2t")
|
||||
big_blob = ExtResource("2_o1i15")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
rotation = 1.5708
|
||||
|
|
|
|||
BIN
bubble.png
Normal file
BIN
bubble.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
40
bubble.png.import
Normal file
40
bubble.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvlvu37up72gt"
|
||||
path="res://.godot/imported/bubble.png-3dc4d46c6bed7b70ac6f4b3bfb630a9b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://bubble.png"
|
||||
dest_files=["res://.godot/imported/bubble.png-3dc4d46c6bed7b70ac6f4b3bfb630a9b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=11 format=3 uid="uid://cxo6bq26huau7"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://cxo6bq26huau7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"]
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
[ext_resource type="Script" uid="uid://3k6r3jnko4hg" path="res://show_fps.gd" id="8_5vw27"]
|
||||
[ext_resource type="PackedScene" uid="uid://b62xcg0dd3vct" path="res://enemies/leech.tscn" id="9_kek77"]
|
||||
[ext_resource type="PackedScene" uid="uid://ca5ndobertnp4" path="res://water/water.tscn" id="10_4c57u"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpe4s6vsn0ujd" path="res://boss.tscn" id="11_efxa6"]
|
||||
|
||||
[node name="main" type="Node2D"]
|
||||
|
||||
|
|
@ -73,8 +74,10 @@ z_index = 15
|
|||
|
||||
[node name="CanvasLayer-1" type="CanvasLayer" parent="."]
|
||||
layer = -1
|
||||
visible = false
|
||||
|
||||
[node name="ColorRect" type="TextureRect" parent="CanvasLayer-1"]
|
||||
visible = false
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
|
@ -82,6 +85,9 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
texture = ExtResource("3_kek77")
|
||||
|
||||
[node name="Boss" parent="." instance=ExtResource("11_efxa6")]
|
||||
position = Vector2(0, -3500)
|
||||
|
||||
[connection signal="active_item_changed" from="Player" to="CanvasLayer1/ItemUI" method="_on_player_active_item_changed"]
|
||||
[connection signal="health_changed" from="Player" to="CanvasLayer1/Healthbar" method="_on_player_health_changed"]
|
||||
[connection signal="max_hp_changed" from="Player" to="CanvasLayer1/Healthbar" method="_on_player_max_hp_changed"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue