17 changed files with 426 additions and 0 deletions
@ -0,0 +1,11 @@
|
||||
extends Particles2D |
||||
|
||||
onready var timer = $Timer |
||||
onready var spawn_handler = get_parent() |
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
pass |
||||
|
||||
func play(position): |
||||
self.position = position |
||||
self.visible = true |
||||
@ -0,0 +1,44 @@
|
||||
[gd_scene load_steps=7 format=2] |
||||
|
||||
[ext_resource path="res://Assets/DeathAnimation.gd" type="Script" id=1] |
||||
|
||||
[sub_resource type="Gradient" id=1] |
||||
offsets = PoolRealArray( 0, 0.562963 ) |
||||
colors = PoolColorArray( 0, 0, 0, 1, 0.168627, 0.0470588, 0.184314, 0.694118 ) |
||||
|
||||
[sub_resource type="GradientTexture" id=2] |
||||
gradient = SubResource( 1 ) |
||||
|
||||
[sub_resource type="Curve" id=3] |
||||
_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.5044 ), -0.217525, 0.0, 0, 0 ] |
||||
|
||||
[sub_resource type="CurveTexture" id=4] |
||||
curve = SubResource( 3 ) |
||||
|
||||
[sub_resource type="ParticlesMaterial" id=5] |
||||
flag_disable_z = true |
||||
spread = 90.0 |
||||
gravity = Vector3( 0, 0, 0 ) |
||||
initial_velocity = 3.0 |
||||
angular_velocity = 180.0 |
||||
orbit_velocity = 0.0 |
||||
orbit_velocity_random = 0.0 |
||||
scale = 2.0 |
||||
scale_curve = SubResource( 4 ) |
||||
color_ramp = SubResource( 2 ) |
||||
|
||||
[node name="DeathAnimation" type="Particles2D"] |
||||
visible = false |
||||
rotation = -1.5708 |
||||
amount = 40 |
||||
lifetime = 5.0 |
||||
one_shot = true |
||||
speed_scale = 5.0 |
||||
explosiveness = 0.65 |
||||
process_material = SubResource( 5 ) |
||||
script = ExtResource( 1 ) |
||||
|
||||
[node name="Timer" type="Timer" parent="."] |
||||
one_shot = true |
||||
autostart = true |
||||
|
||||
@ -0,0 +1,15 @@
|
||||
extends Particles2D |
||||
|
||||
onready var timer = $Timer |
||||
onready var spawn_handler = get_parent() |
||||
signal timeout |
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
timer.connect("timeout", self, "print_signal") |
||||
|
||||
func play(position): |
||||
self.position = position |
||||
self.visible = true |
||||
|
||||
func print_signal(): |
||||
print("Looks like the signal went, but it didn't hear you...") |
||||
@ -0,0 +1,78 @@
|
||||
[gd_scene load_steps=12 format=2] |
||||
|
||||
[ext_resource path="res://Assets/SpawnAnimation.gd" type="Script" id=1] |
||||
|
||||
[sub_resource type="Gradient" id=1] |
||||
colors = PoolColorArray( 0, 0, 0, 1, 0.148519, 0.0170898, 0.15625, 0.568627 ) |
||||
|
||||
[sub_resource type="GradientTexture" id=2] |
||||
gradient = SubResource( 1 ) |
||||
|
||||
[sub_resource type="Curve" id=3] |
||||
_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 0.958066, 0.654 ), -0.467473, 0.0, 0, 0 ] |
||||
|
||||
[sub_resource type="CurveTexture" id=4] |
||||
curve = SubResource( 3 ) |
||||
|
||||
[sub_resource type="ParticlesMaterial" id=5] |
||||
emission_shape = 2 |
||||
emission_box_extents = Vector3( 1, 9, 1 ) |
||||
flag_disable_z = true |
||||
spread = 69.83 |
||||
gravity = Vector3( 0, 0, 0 ) |
||||
initial_velocity = 5.0 |
||||
angular_velocity = 350.0 |
||||
orbit_velocity = 0.0 |
||||
orbit_velocity_random = 0.0 |
||||
scale = 2.0 |
||||
scale_curve = SubResource( 4 ) |
||||
color_ramp = SubResource( 2 ) |
||||
|
||||
[sub_resource type="Gradient" id=6] |
||||
colors = PoolColorArray( 0.151566, 0.0367432, 0.167969, 1, 0.329412, 0.32549, 0.32549, 0.372549 ) |
||||
|
||||
[sub_resource type="GradientTexture" id=7] |
||||
gradient = SubResource( 6 ) |
||||
|
||||
[sub_resource type="Curve" id=8] |
||||
_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.3284 ), -1.18516, 0.0, 0, 0 ] |
||||
|
||||
[sub_resource type="CurveTexture" id=9] |
||||
curve = SubResource( 8 ) |
||||
|
||||
[sub_resource type="ParticlesMaterial" id=10] |
||||
emission_shape = 2 |
||||
emission_box_extents = Vector3( 1, 6, 1 ) |
||||
flag_disable_z = true |
||||
spread = 0.0 |
||||
gravity = Vector3( 0, 0, 0 ) |
||||
initial_velocity = 15.0 |
||||
angular_velocity = 180.0 |
||||
orbit_velocity = 0.0 |
||||
orbit_velocity_random = 0.0 |
||||
scale = 2.0 |
||||
scale_curve = SubResource( 9 ) |
||||
color_ramp = SubResource( 7 ) |
||||
|
||||
[node name="SpawnAnimation" type="Particles2D"] |
||||
visible = false |
||||
position = Vector2( 0, 3.5 ) |
||||
rotation = -1.5708 |
||||
amount = 90 |
||||
lifetime = 1.5 |
||||
speed_scale = 2.0 |
||||
randomness = 1.0 |
||||
process_material = SubResource( 5 ) |
||||
script = ExtResource( 1 ) |
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."] |
||||
amount = 30 |
||||
lifetime = 1.5 |
||||
speed_scale = 2.0 |
||||
process_material = SubResource( 10 ) |
||||
|
||||
[node name="Timer" type="Timer" parent="."] |
||||
wait_time = 2.0 |
||||
one_shot = true |
||||
autostart = true |
||||
|
||||
@ -0,0 +1,47 @@
|
||||
extends "res://Entity/Player/Skill/Skill.gd" |
||||
|
||||
onready var charge_timer = get_node("ChargeTimer") |
||||
onready var movement_tween = get_node("MovementTween") |
||||
onready var ready = false |
||||
onready var loaded = false |
||||
|
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
self.cooldown = 1.5 |
||||
self.image_texture = preload("res://Assets/Art/boots_16.png") |
||||
self.entity = get_parent().get_parent() |
||||
self.cooldown_timer.connect("timeout", self, "off_cooldown") |
||||
|
||||
self.charge_timer.connect("timeout", self, "ready_spell") |
||||
self.entity.get_node("ButtonPress").connect("firebolt", self, "load_firebolt") |
||||
self.movement_tween.connect("tween_completed", self, "end_spell") |
||||
|
||||
func load_firebolt(): |
||||
if !ready && !loaded && charge_timer.is_stopped(): |
||||
print("GOTCHA BITCH!") |
||||
entity.movement_lock(1.5) |
||||
charge_timer.start(1.5) |
||||
elif ready && loaded: |
||||
self.loaded = false |
||||
var global_xform = self.get_global_transform() |
||||
var tree = get_tree().get_root() |
||||
self.get_parent().remove_child(self) |
||||
tree.add_child(self) |
||||
self.transform = global_xform |
||||
self.movement_tween.interpolate_method(self, "move_and_slide", Vector2(-200, 0), Vector2(-200,0), 0.4, Tween.TRANS_LINEAR, Tween.EASE_IN) |
||||
self.movement_tween.start() |
||||
|
||||
func ready_spell(): |
||||
self.position = Vector2(0, -8) |
||||
self.visible = true |
||||
self.get_node("CollisionPolygon2D").disabled = false |
||||
self.ready = true |
||||
self.loaded = true |
||||
|
||||
func end_spell(arg1, arg2): |
||||
print("spell dun") |
||||
|
||||
self.position = entity.position |
||||
self.visible = false |
||||
self.get_node("CollisionPolygon2D").disabled = true |
||||
self.ready = false |
||||
@ -0,0 +1,62 @@
|
||||
[gd_scene load_steps=8 format=2] |
||||
|
||||
[ext_resource path="res://Entity/Player/Skill/Firebolt/Firebolt.gd" type="Script" id=1] |
||||
|
||||
[sub_resource type="CircleShape2D" id=1] |
||||
radius = 3.86178 |
||||
|
||||
[sub_resource type="Gradient" id=2] |
||||
offsets = PoolRealArray( 0.0518519, 0.57037, 1 ) |
||||
colors = PoolColorArray( 0.835938, 0.190754, 0.094696, 1, 0.784314, 0.65098, 0.188235, 0.862745, 0.588235, 0.584314, 0.584314, 0.556863 ) |
||||
|
||||
[sub_resource type="GradientTexture" id=3] |
||||
gradient = SubResource( 2 ) |
||||
|
||||
[sub_resource type="Curve" id=4] |
||||
_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 0.424702, 0.7596 ), -0.405144, -0.405144, 0, 0, Vector2( 1, 0.5132 ), 0.0, 0.0, 0, 0 ] |
||||
|
||||
[sub_resource type="CurveTexture" id=5] |
||||
curve = SubResource( 4 ) |
||||
|
||||
[sub_resource type="ParticlesMaterial" id=6] |
||||
emission_shape = 1 |
||||
emission_sphere_radius = 3.0 |
||||
flag_disable_z = true |
||||
spread = 0.0 |
||||
gravity = Vector3( 0, -5.23, 0 ) |
||||
initial_velocity = 11.49 |
||||
angular_velocity = 350.0 |
||||
angular_velocity_random = 0.11 |
||||
orbit_velocity = 0.0 |
||||
orbit_velocity_random = 0.0 |
||||
scale = 2.0 |
||||
scale_curve = SubResource( 5 ) |
||||
color_ramp = SubResource( 3 ) |
||||
anim_speed = 128.0 |
||||
|
||||
[node name="Firebolt" type="KinematicBody2D"] |
||||
visible = false |
||||
collision_layer = 4 |
||||
collision_mask = 8 |
||||
script = ExtResource( 1 ) |
||||
|
||||
[node name="ChargeTimer" type="Timer" parent="."] |
||||
one_shot = true |
||||
|
||||
[node name="MovementTween" type="Tween" parent="."] |
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="."] |
||||
shape = SubResource( 1 ) |
||||
disabled = true |
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."] |
||||
rotation = -1.5708 |
||||
amount = 150 |
||||
lifetime = 0.8 |
||||
speed_scale = 1.5 |
||||
randomness = 1.0 |
||||
local_coords = false |
||||
process_material = SubResource( 6 ) |
||||
|
||||
[node name="Timer" type="Timer" parent="."] |
||||
|
||||
@ -0,0 +1,4 @@
|
||||
extends "res://Global/Stat.gd" |
||||
|
||||
func _ready(): |
||||
self.stat = "strength" |
||||
@ -0,0 +1,13 @@
|
||||
extends TextureRect |
||||
|
||||
# Declare member variables here. Examples: |
||||
# var a = 2 |
||||
# var b = "text" |
||||
|
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
pass # Replace with function body. |
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame. |
||||
#func _process(delta): |
||||
# pass |
||||
@ -0,0 +1,41 @@
|
||||
extends Area2D |
||||
|
||||
var field |
||||
var entity |
||||
onready var spawn_animation = preload("res://Assets/SpawnAnimation.tscn") |
||||
onready var death_animation = preload("res://Assets/DeathAnimation.tscn") |
||||
|
||||
func _ready(): |
||||
field = get_parent() |
||||
|
||||
|
||||
|
||||
func spawn_monster(entity, spawn_point): |
||||
var animation = spawn_animation.instance() |
||||
add_child(animation) |
||||
animation.play(spawn_point) |
||||
$sfx_spawn_monster.play() |
||||
print("Yielding...") |
||||
yield(animation.get_node("Timer"), "timeout") |
||||
print("Yield over.") |
||||
animation.queue_free() |
||||
|
||||
entity = entity.instance() |
||||
entity.position = spawn_point |
||||
entity.connect("death_signal", self, "on_death") |
||||
|
||||
field.entities.add_child(entity) |
||||
|
||||
|
||||
func on_death(entity): |
||||
var animation = death_animation.instance() |
||||
add_child(animation) |
||||
animation.play(entity.position) |
||||
entity.queue_free() |
||||
yield(animation.get_node("Timer"), "timeout") |
||||
animation.queue_free() |
||||
|
||||
|
||||
field.enemy_counter -= 1 |
||||
if(field.enemy_counter == 0): |
||||
field.spawn_trigger() |
||||
@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=5 format=2] |
||||
|
||||
[ext_resource path="res://Global/SpawnHandler.gd" type="Script" id=1] |
||||
[ext_resource path="res://Assets/Audio/dungeon_monster_appear1.wav" type="AudioStream" id=2] |
||||
[ext_resource path="res://Assets/SpawnAnimation.tscn" type="PackedScene" id=3] |
||||
[ext_resource path="res://Assets/DeathAnimation.tscn" type="PackedScene" id=4] |
||||
|
||||
[node name="SpawnAnimation" type="Area2D"] |
||||
script = ExtResource( 1 ) |
||||
|
||||
[node name="sfx_spawn_monster" type="AudioStreamPlayer2D" parent="."] |
||||
stream = ExtResource( 2 ) |
||||
volume_db = -33.237 |
||||
|
||||
[node name="SpawnAnimation" parent="." instance=ExtResource( 3 )] |
||||
|
||||
[node name="DeathAnimation" parent="." instance=ExtResource( 4 )] |
||||
|
||||
@ -0,0 +1,18 @@
|
||||
extends Control |
||||
|
||||
var stat |
||||
onready var amount = PlayerInfo.Player.get(stat) |
||||
onready var amount_display = get_node("Amount") |
||||
onready var button = get_node("Button") |
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
set_amount(amount) |
||||
button.connect("button_up", self, "increment_stat") |
||||
|
||||
func set_amount(amount): |
||||
amount_display.text = amount |
||||
|
||||
func increment_stat(): |
||||
amount += 1 |
||||
set_amount(amount) |
||||
PlayerInfo.Player.set(stat, amount) |
||||
@ -0,0 +1,4 @@
|
||||
extends "res://Global/Stat.gd" |
||||
|
||||
func _ready(): |
||||
self.stat = "dexterity" |
||||
@ -0,0 +1,4 @@
|
||||
extends "res://Global/Stat.gd" |
||||
|
||||
func _ready(): |
||||
self.stat = "intelligence" |
||||
@ -0,0 +1,4 @@
|
||||
extends "res://Global/Stat.gd" |
||||
|
||||
func _ready(): |
||||
self.stat = "strength" |
||||
@ -0,0 +1,30 @@
|
||||
extends VBoxContainer |
||||
|
||||
var stats |
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
stats = { |
||||
"strength": get_node("Stat1"), |
||||
"dexterity": get_node("Stat2"), |
||||
"intelligence": get_node("Stat3"), |
||||
"vitality": get_node("Stat4") |
||||
} |
||||
|
||||
for stat in stats.keys(): |
||||
stats[stat].get_node("Button").connect("button_up", self, "increment_stat", [stat]) |
||||
|
||||
func update_stats(): |
||||
var children = get_children() |
||||
for stat in stats: |
||||
var points = PlayerInfo.Player.get(stat) |
||||
stats[stat].get_node("Points").text = str(points) |
||||
|
||||
func set_points(node, points): |
||||
node.get_node("Points").text = str(points) |
||||
|
||||
func increment_stat(stat): |
||||
var node = stats[stat] |
||||
var points = PlayerInfo.Player.get(stat) |
||||
points += 1 |
||||
set_points(node, points) |
||||
PlayerInfo.Player.set(stat, points) |
||||
@ -0,0 +1,5 @@
|
||||
[gd_scene format=2] |
||||
|
||||
[node name="Node2D" type="Node2D"] |
||||
position = Vector2( 0, -0.735092 ) |
||||
|
||||
@ -0,0 +1,28 @@
|
||||
extends Sprite |
||||
|
||||
onready var speed = 120 |
||||
onready var path = get_parent().get_parent().get_node("Path2D/PathFollow2D") |
||||
onready var parent = get_parent() |
||||
# Declare member variables here. Examples: |
||||
# var a = 2 |
||||
# var b = "text" |
||||
var previous_position |
||||
var current_position |
||||
|
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
set_process(true) |
||||
|
||||
func _process(delta): |
||||
if path.unit_offset < 1: |
||||
previous_position = path.position |
||||
path.offset = path.offset+(speed*delta) |
||||
current_position = path.position |
||||
parent.move_and_slide((current_position - previous_position)/0.017) |
||||
print(parent.position) |
||||
else: |
||||
print("dunzo") |
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame. |
||||
#func _process(delta): |
||||
# pass |
||||
Loading…
Reference in new issue