mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-12 13:32:23 +02:00
Merge branch 'devEffects' into devRefactor
This commit is contained in:
BIN
src/Effects/Fire/fire-particle.png
Normal file
BIN
src/Effects/Fire/fire-particle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 316 B |
34
src/Effects/Fire/fire-particle.png.import
Normal file
34
src/Effects/Fire/fire-particle.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fire-particle.png-542cf206ab06c7c5fa130fcfeee388bd.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Effects/Fire/fire-particle.png"
|
||||
dest_files=[ "res://.import/fire-particle.png-542cf206ab06c7c5fa130fcfeee388bd.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
|
||||
18
src/Effects/Heal/HealEffect.tscn
Normal file
18
src/Effects/Heal/HealEffect.tscn
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Effects/Heal/heal_particle.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=1]
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 5.0
|
||||
flag_disable_z = true
|
||||
gravity = Vector3( 0, -5, 0 )
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
scale = 0.25
|
||||
|
||||
[node name="HealEffect" type="Particles2D"]
|
||||
amount = 10
|
||||
lifetime = 2.0
|
||||
process_material = SubResource( 1 )
|
||||
texture = ExtResource( 1 )
|
||||
BIN
src/Effects/Heal/heal_particle.png
Normal file
BIN
src/Effects/Heal/heal_particle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 122 B |
34
src/Effects/Heal/heal_particle.png.import
Normal file
34
src/Effects/Heal/heal_particle.png.import
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -12,9 +13,13 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[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 )]
|
||||
margin_left = 1.19746
|
||||
margin_right = 1.19745
|
||||
|
||||
[node name="DragSource" parent="." instance=ExtResource( 1 )]
|
||||
PreviewIcon = "res://icon.png"
|
||||
margin_right = 1.19745
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -24,6 +24,8 @@ var _rng = RandomNumberGenerator.new()
|
||||
var is_playing_sound = false
|
||||
|
||||
|
||||
export(String, FILE, "*.tscn,*.scn") var title_scene = ""
|
||||
|
||||
enum moveState{
|
||||
MOVE,
|
||||
ROLL,
|
||||
@@ -34,6 +36,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
|
||||
@@ -44,7 +47,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
|
||||
@@ -62,6 +65,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
|
||||
@@ -122,18 +127,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
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
[ext_resource path="res://Player/States/Attack.gd" type="Script" id=14]
|
||||
[ext_resource path="res://Player/PlayerStateMachine.gd" type="Script" id=15]
|
||||
[ext_resource path="res://Player/States/Roll.gd" type="Script" id=16]
|
||||
[ext_resource path="res://Effects/Heal/HealEffect.tscn" type="PackedScene" id=7]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 2.15976
|
||||
@@ -625,6 +626,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 )
|
||||
@@ -731,6 +733,11 @@ script = ExtResource( 14 )
|
||||
|
||||
[node name="Roll" type="Node" parent="AnimationStates"]
|
||||
script = ExtResource( 16 )
|
||||
[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"]
|
||||
|
||||
Reference in New Issue
Block a user