Morning Star
This commit is contained in:
parent
5dca64d944
commit
ce99e4c2ee
12 changed files with 69 additions and 9 deletions
|
|
@ -1,9 +1,10 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://djawvtdwp423v"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://djawvtdwp423v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_5j34s"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="2_2yopf"]
|
||||
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_f1gjg"]
|
||||
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_qnfc1"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://morning_star.tscn" id="5_xr4t5"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
|
||||
resource_local_to_scene = true
|
||||
|
|
@ -16,8 +17,12 @@ shader_parameter/num_cells = 60
|
|||
script = ExtResource("1_5j34s")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
self_modulate = Color(0.1764706, 0, 0.003921569, 0.003921569)
|
||||
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
|
||||
material = SubResource("ShaderMaterial_qnfc1")
|
||||
scale = Vector2(15, 15)
|
||||
texture = ExtResource("2_2yopf")
|
||||
script = ExtResource("4_qnfc1")
|
||||
|
||||
[node name="EnemyList" type="Node2D" parent="."]
|
||||
|
||||
[node name="MorningStar" parent="EnemyList" instance=ExtResource("5_xr4t5")]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://bno6flekdwx88"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cmofmd0vf3hx3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_q3nfb"]
|
||||
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_uv7v8"]
|
||||
|
|
@ -18,7 +18,7 @@ script = ExtResource("1_q3nfb")
|
|||
dimension = Vector2i(1, 2)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
self_modulate = Color(0.1764706, 0, 0.003921569, 0.003921569)
|
||||
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
|
||||
material = SubResource("ShaderMaterial_qnfc1")
|
||||
scale = Vector2(25, 25)
|
||||
texture = ExtResource("3_e6j05")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://chu67ci7sl488"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://12jns4dppxxj" path="res://enemies/ghost.gd" id="1_6attn"]
|
||||
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://enemy_hurtbox.tscn" id="2_34o1m"]
|
||||
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_34o1m"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="2_obmiq"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_obmiq"]
|
||||
|
||||
|
|
@ -10,6 +10,8 @@
|
|||
[node name="Ghost" type="Area2D"]
|
||||
z_index = 1
|
||||
scale = Vector2(0.4, 0.4)
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_6attn")
|
||||
|
||||
[node name="EnemyHurtbox" parent="." instance=ExtResource("2_34o1m")]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://cxo6bq26huau7"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cxo6bq26huau7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
||||
[ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="2_lquwl"]
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://jjoyj1ldafkf" path="res://world/earth.tscn" id="3_lquwl"]
|
||||
[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="4_1bvp3"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://morning_star.tscn" id="7_272bh"]
|
||||
|
||||
[node name="main" type="Node2D"]
|
||||
|
||||
|
|
@ -34,5 +35,8 @@ autostart = true
|
|||
offset_right = 128.0
|
||||
offset_bottom = 128.0
|
||||
|
||||
[node name="MorningStar" parent="." instance=ExtResource("7_272bh")]
|
||||
position = Vector2(989, -2939)
|
||||
|
||||
[connection signal="health_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_health_changed"]
|
||||
[connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"]
|
||||
|
|
|
|||
23
morning_star.gd
Normal file
23
morning_star.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
extends Node2D
|
||||
@onready var ball : Area2D = $Area2D
|
||||
var anglespeed = 0.3
|
||||
var player_damage = 1
|
||||
var enemy_damage = 10
|
||||
|
||||
func _ready() -> void:
|
||||
rotate(randf() * TAU)
|
||||
anglespeed = anglespeed * (2 * randi_range(0,1) - 1)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
rotate(anglespeed * delta * TAU)
|
||||
for target in ball.get_overlapping_areas():
|
||||
damage_target(target)
|
||||
for target in ball.get_overlapping_bodies():
|
||||
damage_target(target)
|
||||
|
||||
func damage_target(target: CollisionObject2D):
|
||||
var dir = (position - target.position).normalized()
|
||||
if(target.get_collision_layer_value(3)):
|
||||
target.hurt(player_damage, dir)
|
||||
else:
|
||||
target.hurt(enemy_damage, 2.5*dir)
|
||||
1
morning_star.gd.uid
Normal file
1
morning_star.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bjarfrf4tf3b1
|
||||
23
morning_star.tscn
Normal file
23
morning_star.tscn
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dpv1w56yr1xue"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjarfrf4tf3b1" path="res://morning_star.gd" id="1_iuq6u"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_ytaxb"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_iuq6u"]
|
||||
|
||||
[node name="MorningStar" type="Node2D"]
|
||||
script = ExtResource("1_iuq6u")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
position = Vector2(0, -200)
|
||||
scale = Vector2(3, 3)
|
||||
collision_layer = 0
|
||||
collision_mask = 6
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("CircleShape2D_iuq6u")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Area2D"]
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
scale = Vector2(0.15, 0.15)
|
||||
texture = ExtResource("1_ytaxb")
|
||||
|
|
@ -40,6 +40,7 @@ animations = [{
|
|||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
z_index = 10
|
||||
collision_layer = 5
|
||||
script = ExtResource("1_4flbx")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ config_version=5
|
|||
|
||||
config/name="The Dark Side of Earth"
|
||||
run/main_scene="uid://cxo6bq26huau7"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
|
@ -47,3 +47,4 @@ attack={
|
|||
[layer_names]
|
||||
|
||||
2d_physics/layer_2="EnemyHurtBox"
|
||||
2d_physics/layer_3="PlayerHurtBox"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ extends Area2D
|
|||
|
||||
@export var max_hp : int
|
||||
@onready var hp = max_hp
|
||||
var hit_invulnerability = 0.15
|
||||
@export var hit_invulnerability = 0.35
|
||||
var inv_time = 0;
|
||||
|
||||
signal damage_taken
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://mtfsdd4cdf3a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ct8am2xeyymuj" path="res://enemy_hurtbox.gd" id="1_wa58b"]
|
||||
[ext_resource type="Script" uid="uid://ct8am2xeyymuj" path="res://utils/enemy_hurtbox.gd" id="1_wa58b"]
|
||||
|
||||
[node name="EnemyHurtbox" type="Area2D"]
|
||||
collision_layer = 2
|
||||
Loading…
Add table
Reference in a new issue