Compare commits
4 Commits
0feaca2911
...
c3f57e2315
Author | SHA1 | Date |
---|---|---|
Luna Brovchuk | c3f57e2315 | |
Luna Brovchuk | 043f3a5d93 | |
Luna Brovchuk | 4f32f718c6 | |
Luna Brovchuk | c513c48f8b |
|
@ -3,7 +3,6 @@
|
|||
[ext_resource path="res://res/fonts/silkscreen/Silkscreen-Regular.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 8
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[resource]
|
||||
|
|
|
@ -41,8 +41,10 @@ func area_entered(area):
|
|||
prev_target = parent
|
||||
parent.deal_damage(damage)
|
||||
parent.freeze_modifier = freeze_modifier
|
||||
parent.frozen_timer = 0
|
||||
parent.poison_damage = poison_damage
|
||||
if ricochet_count >= bounced:
|
||||
parent.poisoned_timer = 0
|
||||
if bounced >= ricochet_count:
|
||||
call_deferred("free")
|
||||
choose_target()
|
||||
bounced += 1
|
||||
|
|
|
@ -11,7 +11,7 @@ var shot = false
|
|||
var sonic_wave
|
||||
|
||||
func _ready():
|
||||
hp = 15
|
||||
hp = 7
|
||||
|
||||
func _physics_process(delta):
|
||||
if not shooting:
|
||||
|
|
|
@ -16,7 +16,7 @@ use_parent_material = true
|
|||
position = Vector2( -3, 0 )
|
||||
frames = ExtResource( 1 )
|
||||
animation = "idle"
|
||||
frame = 3
|
||||
frame = 2
|
||||
playing = true
|
||||
centered = false
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ var speed = 24
|
|||
func _ready():
|
||||
randomize()
|
||||
global_position = [Vector2(33, 50), Vector2(287, 70)][randi()%2]
|
||||
hp = 15
|
||||
hp = 7
|
||||
|
||||
func _physics_process(delta):
|
||||
global_position = global_position.move_toward(player.global_position + Vector2(8, 8), speed * delta * speed_multiplier)
|
||||
|
|
|
@ -3,6 +3,7 @@ extends KinematicBody2D
|
|||
onready var fireball_preload = preload("res://src/models/fireball/Fireball.tscn")
|
||||
onready var bullet_preload = preload("res://src/models/bullet/Bullet.tscn")
|
||||
onready var spell_holder = $"../../UIWrapper/UI/Center/SpellHolder"
|
||||
var colorize_material = load("res://res/shaders/colorize.tres")
|
||||
var outline_material = load("res://res/shaders/outline_material.tres")
|
||||
#var outline_material = load("res://res/shaders/empty_material.tres")
|
||||
var speed_multiplier: float = 1.0
|
||||
|
@ -10,6 +11,7 @@ var invincibility_timer = .0
|
|||
var velocity = Vector2.ZERO
|
||||
var recharge_timer = .0
|
||||
var invincible = false
|
||||
var stunned = false
|
||||
var target
|
||||
var slowed = false
|
||||
var speed = 80
|
||||
|
@ -101,16 +103,19 @@ func _shoot():
|
|||
bullet.freeze_modifier = freeze_modifier
|
||||
bullet.poison_damage = poison_damage
|
||||
bullet.speed_modifier = speed_modifier
|
||||
bullet.ricochet_count = ricochet_count
|
||||
|
||||
get_parent().add_child(bullet)
|
||||
bullet.global_position.x = self.global_position.x + 8
|
||||
bullet.global_position.y = self.global_position.y + 8
|
||||
|
||||
bullet = fireball_preload.instance()
|
||||
bullet.target = target
|
||||
get_parent().add_child(bullet)
|
||||
bullet.global_position.x = self.global_position.x + 8
|
||||
bullet.global_position.y = self.global_position.y + 8
|
||||
for i in range(fireball_amount):
|
||||
var fireball = fireball_preload.instance()
|
||||
fireball.target = target
|
||||
get_parent().add_child(fireball)
|
||||
fireball.global_position.x = self.global_position.x + 8
|
||||
randomize()
|
||||
fireball.global_position.y = self.global_position.y + 8 + randi()%8 - 4
|
||||
|
||||
func _draw():
|
||||
if target != null and is_instance_valid(target) and not target.dead:
|
||||
|
@ -143,11 +148,6 @@ func _process(_delta):
|
|||
func _physics_process(delta):
|
||||
get_input()
|
||||
|
||||
invincibility_timer += delta
|
||||
|
||||
if recharge_timer <= get_recharge():
|
||||
recharge_timer += delta
|
||||
|
||||
var areas = $DirtCollision.get_overlapping_areas()
|
||||
slowed = false
|
||||
for area in areas:
|
||||
|
@ -171,6 +171,9 @@ func _physics_process(delta):
|
|||
|
||||
if Global.playing:
|
||||
$Sprite.playing = true
|
||||
invincibility_timer += delta
|
||||
if recharge_timer <= get_recharge():
|
||||
recharge_timer += delta
|
||||
velocity = move_and_slide(velocity * speed_multiplier)
|
||||
else:
|
||||
$Sprite.playing = false
|
||||
|
@ -179,7 +182,6 @@ func _physics_process(delta):
|
|||
|
||||
if Global.playing and target != null and is_instance_valid(target) and not target.dead:
|
||||
target.material = outline_material
|
||||
|
||||
if recharge_timer >= get_recharge():
|
||||
_shoot()
|
||||
recharge_timer = .0
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/scenes/game/sprites/gameover.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/scenes/death/death.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "gameover"
|
||||
length = 3.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1.5, 3 ),
|
||||
"transitions": PoolRealArray( 29.8571, 2, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 0, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[node name="Death" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Gameover" type="Control" parent="."]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Gameover"]
|
||||
modulate = Color( 1, 1, 1, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Gameover"]
|
||||
autoplay = "gameover"
|
||||
anims/RESET = SubResource( 1 )
|
||||
anims/gameover = SubResource( 2 )
|
||||
|
||||
[connection signal="animation_finished" from="Gameover/AnimationPlayer" to="." method="animation_finished"]
|
|
@ -0,0 +1,7 @@
|
|||
extends Node2D
|
||||
|
||||
func _ready():
|
||||
AudioDead.play()
|
||||
|
||||
func animation_finished(anim_name):
|
||||
Global.return_to_menu()
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=27 format=2]
|
||||
[gd_scene load_steps=24 format=2]
|
||||
|
||||
[ext_resource path="res://src/scenes/menu/background/background.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/scenes/game/sprites/background_houses.png" type="Texture" id=2]
|
||||
|
@ -14,7 +14,6 @@
|
|||
[ext_resource path="res://src/scenes/game/sprites/ui_background.png" type="Texture" id=12]
|
||||
[ext_resource path="res://src/scenes/game/sprites/hatch1.png" type="Texture" id=13]
|
||||
[ext_resource path="res://src/scenes/game/sprites/hatch2.png" type="Texture" id=14]
|
||||
[ext_resource path="res://src/scenes/game/sprites/gameover.png" type="Texture" id=15]
|
||||
[ext_resource path="res://src/scenes/game/spell_recharge_bar.gd" type="Script" id=16]
|
||||
[ext_resource path="res://src/scenes/game/sprites/stun/stun_spriteframes.tres" type="SpriteFrames" id=17]
|
||||
[ext_resource path="res://src/models/card/Card.tscn" type="PackedScene" id=18]
|
||||
|
@ -29,37 +28,6 @@ extents = Vector2( 10, 60 )
|
|||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 140, 10.125 )
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
resource_name = "gameover"
|
||||
length = 3.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 1.5, 3 ),
|
||||
"transitions": PoolRealArray( 3.24901, 29.8571, 2, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 0, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[node name="Game" type="Node"]
|
||||
script = ExtResource( 11 )
|
||||
|
||||
|
@ -327,17 +295,3 @@ id = 2
|
|||
|
||||
[node name="AudioCardSelect" type="AudioStreamPlayer" parent="UIWrapper/UI/Cards/RightPlaceholder"]
|
||||
stream = ExtResource( 9 )
|
||||
|
||||
[node name="Gameover" type="Control" parent="UIWrapper/UI"]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="UIWrapper/UI/Gameover"]
|
||||
modulate = Color( 1, 1, 1, 0 )
|
||||
texture = ExtResource( 15 )
|
||||
centered = false
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="UIWrapper/UI/Gameover"]
|
||||
anims/RESET = SubResource( 5 )
|
||||
anims/gameover = SubResource( 6 )
|
||||
|
|
|
@ -4,4 +4,4 @@ onready var player = get_tree().get_root().get_node("Game/View/Player")
|
|||
var max_size = 80
|
||||
|
||||
func _process(delta):
|
||||
$ColorRect.rect_size.x = max_size * (player.recharge_timer / player.get_recharge())
|
||||
$ColorRect.rect_size.x = max_size * (clamp(player.recharge_timer, 0, player.get_recharge()) / player.get_recharge())
|
||||
|
|
|
@ -56,14 +56,17 @@ func _physics_process(delta):
|
|||
poison_damage = 0
|
||||
if poisoned_damage_timer >= 1:
|
||||
deal_damage(poison_damage)
|
||||
poisoned_damage_timer = 0
|
||||
|
||||
if freeze_modifier != 1:
|
||||
$Sprite.modulate.b = 1.2
|
||||
frozen_timer += delta
|
||||
speed_multiplier = freeze_modifier
|
||||
if frozen_timer >= frozen_time:
|
||||
frozen_time = 0
|
||||
freeze_modifier = 1
|
||||
else:
|
||||
$Sprite.modulate.b = 1
|
||||
speed_multiplier = 1
|
||||
|
||||
if not Global.playing:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
extends Node
|
||||
|
||||
var DEATH_SCENE = preload("res://src/scenes/death/Death.tscn")
|
||||
var GAME_SCENE = preload("res://src/scenes/game/Game.tscn")
|
||||
var MENU_SCENE = preload("res://src/scenes/menu/Menu.tscn")
|
||||
|
||||
|
@ -10,6 +11,9 @@ var health = 5
|
|||
func game_start():
|
||||
get_tree().change_scene_to(GAME_SCENE)
|
||||
|
||||
func death_scene():
|
||||
get_tree().change_scene_to(DEATH_SCENE)
|
||||
|
||||
func return_to_menu():
|
||||
playing = false
|
||||
get_tree().change_scene_to(MENU_SCENE)
|
||||
|
@ -19,9 +23,5 @@ func add_health(amount):
|
|||
get_tree().get_root().get_node("Game/UIWrapper/UI/Left/Health/HealthSprite").frame = health
|
||||
if health == 0:
|
||||
playing = false
|
||||
AudioDead.play()
|
||||
get_tree().get_root().get_node("Game/View/Enemies").free()
|
||||
var animplayer = get_tree().get_root().get_node("Game/UIWrapper/UI/Gameover/AnimationPlayer")
|
||||
animplayer.play("gameover")
|
||||
yield(animplayer, "animation_finished")
|
||||
return_to_menu()
|
||||
death_scene()
|
||||
|
|
Loading…
Reference in New Issue