From 73e35ef2bdfbcad85b86dd5b8f876a1e479233c3 Mon Sep 17 00:00:00 2001 From: Paul Norberger Date: Sat, 18 Apr 2020 20:38:19 +0200 Subject: [PATCH 1/3] Added credit for forgetten team member --- src/Menus/Credits/Credits.tscn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Menus/Credits/Credits.tscn b/src/Menus/Credits/Credits.tscn index 08bcdbc..0ed17f0 100644 --- a/src/Menus/Credits/Credits.tscn +++ b/src/Menus/Credits/Credits.tscn @@ -24,8 +24,8 @@ script = ExtResource( 2 ) scene_to_load = "res://Menus/TitleScreen/TitleScreen.tscn" [node name="ColorRect" type="ColorRect" parent="."] -margin_right = 320.0 -margin_bottom = 180.0 +margin_right = 1024.0 +margin_bottom = 1024.0 color = Color( 0, 0, 0, 1 ) __meta__ = { "_edit_use_anchors_": false @@ -43,6 +43,8 @@ https://www.youtube.com/c/DerAnonymosLP https://twitch.tv/deranonymos https://www.instagram.com/deranonymos/ +Rougebluemulan + Katsuhira https://www.youtube.com/c/Katsuhira https://twitter.com/nKatsuhira From 909be00d6eb9248154cd92d0d4020b362043e11f Mon Sep 17 00:00:00 2001 From: Streamfire Date: Sat, 18 Apr 2020 21:05:59 +0200 Subject: [PATCH 2/3] Dropping into the Dropsink now creates an instance of the given scene --- src/Menus/DragNDrop/DragNDropUI.tscn | 8 +++++++- src/Menus/DragNDrop/DragSink.tscn | 12 +++++++----- src/Menus/DragNDrop/DragSource.tscn | 14 ++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Menus/DragNDrop/DragNDropUI.tscn b/src/Menus/DragNDrop/DragNDropUI.tscn index 6b673fa..695c42c 100644 --- a/src/Menus/DragNDrop/DragNDropUI.tscn +++ b/src/Menus/DragNDrop/DragNDropUI.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://Menus/DragNDrop/DragSource.tscn" type="PackedScene" id=1] [ext_resource path="res://Menus/DragNDrop/DragSink.tscn" type="PackedScene" id=2] +[ext_resource path="res://Objects/Banana/Banana.tscn" type="PackedScene" id=3] [node name="DragNDropUI" type="Control"] anchor_right = 1.0 @@ -13,5 +14,10 @@ __meta__ = { } [node name="DragSource" parent="." instance=ExtResource( 1 )] +margin_left = 12.7532 +margin_top = 230.124 +margin_right = 44.7532 +margin_bottom = 262.124 +Item = ExtResource( 3 ) [node name="DragSink" parent="." instance=ExtResource( 2 )] diff --git a/src/Menus/DragNDrop/DragSink.tscn b/src/Menus/DragNDrop/DragSink.tscn index 481f0a3..e7e9423 100644 --- a/src/Menus/DragNDrop/DragSink.tscn +++ b/src/Menus/DragNDrop/DragSink.tscn @@ -1,23 +1,25 @@ [gd_scene load_steps=2 format=2] -[sub_resource type="GDScript" id=2] +[sub_resource type="GDScript" id=1] script/source = "extends Container #DropZone #stuff can be dropped here func can_drop_data(_pos, data): - return typeof(data) == TYPE_INT + return typeof(data) == typeof(PackedScene) #what is to be done when data is dropped -func drop_data(_pos, data): - print(data) +func drop_data(_pos, data:PackedScene): + var child = data.instance() + child.position= _pos + self.add_child(child) " [node name="DragSink" type="Container"] anchor_right = 1.0 anchor_bottom = 0.789 margin_bottom = -0.0200043 -script = SubResource( 2 ) +script = SubResource( 1 ) __meta__ = { "_edit_use_anchors_": false } diff --git a/src/Menus/DragNDrop/DragSource.tscn b/src/Menus/DragNDrop/DragSource.tscn index 1c8267e..574da6a 100644 --- a/src/Menus/DragNDrop/DragSource.tscn +++ b/src/Menus/DragNDrop/DragSource.tscn @@ -5,18 +5,15 @@ [sub_resource type="GDScript" id=1] script/source = "extends TextureRect #CardDeck -export var ItemID:int=0 -export var PreviewIcon:String = \"\" +export var Item:PackedScene +export var PreviewIcon:Texture export var DeleteOnGrab:bool = false #if a drag is initiated here func get_drag_data(_pos): - print(_pos) - var preview = load(PreviewIcon) var ctrl = Control.new() - var TR = TextureRect.new() - TR.texture = get_resized_texture(preview,self.rect_size[0],self.rect_size[1]) + TR.texture = get_resized_texture(PreviewIcon,self.rect_size[0],self.rect_size[1]) TR.rect_size= self.rect_size TR.set_position(_pos*-1,false) ctrl.add_child(TR) @@ -24,12 +21,12 @@ func get_drag_data(_pos): if DeleteOnGrab : self.queue_free() - return ItemID + return Item #stuff can be dropped here #eg you picked the wrong thing up, let go and it returns to nothingness func can_drop_data(_pos, data): - return typeof(data) == TYPE_INT + return typeof(data) == typeof(PackedScene) #do nothing if stuff is dropped here func drop_data(_pos, _data): @@ -55,3 +52,4 @@ script = SubResource( 1 ) __meta__ = { "_edit_use_anchors_": false } +PreviewIcon = ExtResource( 1 ) From 5e4b93fb36e5b48c2bf3172e95fe70b185607286 Mon Sep 17 00:00:00 2001 From: Paul Norberger Date: Sat, 18 Apr 2020 23:52:28 +0200 Subject: [PATCH 3/3] Heal and Fire Particle Basis added --- src/Effects/Fire/fire-particle.png | Bin 0 -> 316 bytes src/Effects/Fire/fire-particle.png.import | 34 ++++++++++++++++++++++ src/Effects/Heal/HealEffect.tscn | 18 ++++++++++++ src/Effects/Heal/heal_particle.png | Bin 0 -> 122 bytes src/Effects/Heal/heal_particle.png.import | 34 ++++++++++++++++++++++ src/Player/Player.gd | 25 +++++++++++++--- src/Player/Player.tscn | 10 ++++++- 7 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 src/Effects/Fire/fire-particle.png create mode 100644 src/Effects/Fire/fire-particle.png.import create mode 100644 src/Effects/Heal/HealEffect.tscn create mode 100644 src/Effects/Heal/heal_particle.png create mode 100644 src/Effects/Heal/heal_particle.png.import diff --git a/src/Effects/Fire/fire-particle.png b/src/Effects/Fire/fire-particle.png new file mode 100644 index 0000000000000000000000000000000000000000..2ed8e084ba59793e5bef534ab0f2f74fec21fff0 GIT binary patch literal 316 zcmV-C0mJ@@P)Px#_DMuRR49>sk|A=#Knz8nb_#lcgrzfrB>~~Ngf9?~gBbK60l9!L5pG}-sF{X2 z2Qb@!9eLMVr$UxiU;lqg0E~mianQ&=QNMqb$!|jh*fqI!>p=~s)`(Z4oDhKE4O43X zn8Nd*Gw}PYeEy{T(LubX;W7>y9pnuFo8IPcALM;s9Wpao#&EwFkB*sT&2R82C6n6U z=2}sx*-C%!V$)j!zGJxc%lv-HjiLPY9$r&huBIdiYei?;HCcMeCMQJvBBs_bO?#{T z_z^%_1wh#DO?>*A*V1PxI{<9=CiRkCo?0I0=eF<&c~1^L9`c(@^mqXXqiM?0r$Jf( O0000SyqD^>bP0l+XkKa|k4> literal 0 HcmV?d00001 diff --git a/src/Effects/Heal/heal_particle.png.import b/src/Effects/Heal/heal_particle.png.import new file mode 100644 index 0000000..c557870 --- /dev/null +++ b/src/Effects/Heal/heal_particle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/heal_particle.png-e55ff56a89193d8400c827d550e9f7e4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Effects/Heal/heal_particle.png" +dest_files=[ "res://.import/heal_particle.png-e55ff56a89193d8400c827d550e9f7e4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/Player/Player.gd b/src/Player/Player.gd index 70031c6..3c0d7c1 100644 --- a/src/Player/Player.gd +++ b/src/Player/Player.gd @@ -17,6 +17,8 @@ onready var animation_player := $AnimationPlayer onready var animation_tree := $AnimationTree onready var animation_state = animation_tree.get("parameters/playback") +export(String, FILE, "*.tscn,*.scn") var title_scene = "" + enum moveState{ MOVE, ROLL, @@ -26,6 +28,7 @@ enum moveState{ var movementState = moveState.MOVE var damage_per_second := 0.0 +var heal_per_second := 0.0 var totaldamage := 0.0 var currency := 0 @@ -36,7 +39,7 @@ func _debug_update(): func _physics_process(delta): - totaldamage+=damage_per_second*delta + totaldamage+=(damage_per_second - heal_per_second)*delta player_stats.speed+=10*delta while(totaldamage>1): totaldamage-=1 @@ -53,6 +56,8 @@ func _physics_process(delta): moveState.HIT: movement_hit() + print(heal_per_second) + $"Effects/HealEffect".emitting = heal_per_second > 0.0 move() # IMPORTANT: If you are using move_and_slide don't multiply by delta @@ -105,18 +110,30 @@ func roll_finished(): func _on_Hurtbox_area_entered(area): player_stats.health-=area.damage - damage_per_second = damage_per_second + area.damage + + print("enter") + + if area.damage > 0: + damage_per_second += area.damage + else: + heal_per_second += abs(area.damage) func _on_Hurtbox_area_exited(area): - damage_per_second = damage_per_second - area.damage + + if area.damage > 0: + damage_per_second -= area.damage + else: + heal_per_second -= abs(area.damage) func _on_Stats_no_health(): queue_free() - get_tree().change_scene("res://Menus/TitleScreen/TitleScreen.tscn") + get_tree().change_scene(title_scene) func _on_Hitbox_area_entered(area): currency += area.currency_value player_stats.health = player_stats.health+area.health_value player_stats.speed -= area.slowdown_value + + diff --git a/src/Player/Player.tscn b/src/Player/Player.tscn index 5c33152..abbe6b1 100644 --- a/src/Player/Player.tscn +++ b/src/Player/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=56 format=2] +[gd_scene load_steps=57 format=2] [ext_resource path="res://Player/Player.gd" type="Script" id=1] [ext_resource path="res://Player/Player.png" type="Texture" id=2] @@ -6,6 +6,7 @@ [ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=4] [ext_resource path="res://Overlap/Stats/Stats.tscn" type="PackedScene" id=5] [ext_resource path="res://Fonts/Harmonic/Harmonic.ttf" type="DynamicFontData" id=6] +[ext_resource path="res://Effects/Heal/HealEffect.tscn" type="PackedScene" id=7] [sub_resource type="CapsuleShape2D" id=1] radius = 2.15976 @@ -619,6 +620,7 @@ font_data = ExtResource( 6 ) [node name="Player" type="KinematicBody2D"] script = ExtResource( 1 ) FRICTION = 270 +title_scene = "res://Menus/TitleScreen/TitleScreen.tscn" [node name="Sprite" type="Sprite" parent="."] position = Vector2( 0.273621, 3.88423 ) @@ -707,6 +709,12 @@ __meta__ = { [node name="Stats" parent="." instance=ExtResource( 5 )] max_health = 5 + +[node name="Effects" type="Node" parent="."] + +[node name="HealEffect" parent="Effects" instance=ExtResource( 7 )] +position = Vector2( 0, -3.24489 ) +emitting = false [connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"] [connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] [connection signal="area_exited" from="Hurtbox" to="." method="_on_Hurtbox_area_exited"]