Compare commits
No commits in common. "d15f1c528f507bb0f38a0fcab796fd061230a7ed" and "16404c7f5d83a8b899a886dc4d4f28a7ec905f30" have entirely different histories.
d15f1c528f
...
16404c7f5d
|
@ -1,11 +0,0 @@
|
||||||
[gd_resource type="Theme" load_steps=3 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://res/fonts/silkscreen/Silkscreen-Regular.ttf" type="DynamicFontData" id=1]
|
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
|
||||||
size = 8
|
|
||||||
extra_spacing_bottom = -8
|
|
||||||
font_data = ExtResource( 1 )
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
default_font = SubResource( 1 )
|
|
|
@ -12,11 +12,7 @@ func _physics_process(delta):
|
||||||
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
||||||
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
||||||
var target_center = target.global_position + (target_sprite_size / 2)
|
var target_center = target.global_position + (target_sprite_size / 2)
|
||||||
if target.is_in_group("rat"):
|
|
||||||
target_center = target.global_position + Vector2(0, 2)
|
|
||||||
self.global_position = self.global_position.move_toward(target_center, delta * speed)
|
self.global_position = self.global_position.move_toward(target_center, delta * speed)
|
||||||
else:
|
|
||||||
self.call_deferred("free")
|
|
||||||
|
|
||||||
func area_entered(area):
|
func area_entered(area):
|
||||||
var parent = area.get_parent()
|
var parent = area.get_parent()
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/models/bullet/bullet.png" type="Texture" id=1]
|
[ext_resource path="res://src/models/bullet/bullet.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://src/models/bullet/bullet.gd" type="Script" id=2]
|
[ext_resource path="res://src/models/bullet/Bullet.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 3.5, 3.5 )
|
extents = Vector2( 3.5, 3.5 )
|
||||||
|
|
|
@ -25,7 +25,7 @@ flip_h = true
|
||||||
use_parent_material = true
|
use_parent_material = true
|
||||||
frames = ExtResource( 1 )
|
frames = ExtResource( 1 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
frame = 1
|
frame = 4
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ extends EnemyClass
|
||||||
|
|
||||||
onready var player = $"../../Player"
|
onready var player = $"../../Player"
|
||||||
var velocity = Vector2.ZERO
|
var velocity = Vector2.ZERO
|
||||||
var speed = 24
|
var speed = 48
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
hp = 15
|
hp = 15
|
|
@ -1,24 +1,22 @@
|
||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/models/enemies/rat/sprites/rat_spriteframes.tres" type="SpriteFrames" id=1]
|
[ext_resource path="res://src/models/enemies/rat/sprites/rat_spriteframes.tres" type="SpriteFrames" id=1]
|
||||||
[ext_resource path="res://src/models/enemies/rat/rat.gd" type="Script" id=2]
|
[ext_resource path="res://src/models/enemies/rat/Rat.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 8, 3.5 )
|
extents = Vector2( 8, 3 )
|
||||||
|
|
||||||
[node name="Rat" type="KinematicBody2D" groups=["enemy", "rat"]]
|
[node name="Rat" type="KinematicBody2D" groups=["enemy", "rat"]]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="Sprite" type="AnimatedSprite" parent="."]
|
[node name="Sprite" type="AnimatedSprite" parent="."]
|
||||||
use_parent_material = true
|
|
||||||
frames = ExtResource( 1 )
|
frames = ExtResource( 1 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
frame = 3
|
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
position = Vector2( 11, 5.5 )
|
position = Vector2( 12, 6 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
[gd_scene load_steps=4 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://src/models/fireball/fireball.png" type="Texture" id=1]
|
|
||||||
[ext_resource path="res://src/models/fireball/fireball.gd" type="Script" id=2]
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
|
||||||
extents = Vector2( 2, 2 )
|
|
||||||
|
|
||||||
[node name="Fireball" type="KinematicBody2D"]
|
|
||||||
script = ExtResource( 2 )
|
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite" parent="."]
|
|
||||||
position = Vector2( -2, -2 )
|
|
||||||
texture = ExtResource( 1 )
|
|
||||||
centered = false
|
|
||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
|
||||||
shape = SubResource( 1 )
|
|
||||||
|
|
||||||
[connection signal="area_entered" from="Area2D" to="." method="area_entered"]
|
|
|
@ -1,30 +0,0 @@
|
||||||
extends KinematicBody2D
|
|
||||||
|
|
||||||
var velocity = Vector2.ZERO
|
|
||||||
var sin_timer = .0
|
|
||||||
var speed = 64
|
|
||||||
var poisoned = false
|
|
||||||
var damage = 5
|
|
||||||
var frozen = false
|
|
||||||
var target
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
|
||||||
sin_timer += delta
|
|
||||||
if target != null and is_instance_valid(target):
|
|
||||||
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
|
||||||
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
|
||||||
var target_center = target.global_position + (target_sprite_size / 2)
|
|
||||||
if target.is_in_group("rat"):
|
|
||||||
target_center = target.global_position + Vector2(0, 2)
|
|
||||||
var angle = global_position.angle_to_point(target_center)
|
|
||||||
move_and_collide(Vector2(speed, sin(sin_timer * 10) * 90).rotated(angle + PI) * delta)
|
|
||||||
else:
|
|
||||||
self.call_deferred("free")
|
|
||||||
|
|
||||||
func area_entered(area):
|
|
||||||
var parent = area.get_parent()
|
|
||||||
if parent.is_in_group("enemy"):
|
|
||||||
parent.deal_damage(damage)
|
|
||||||
parent.frozen = frozen
|
|
||||||
parent.poisoned = poisoned
|
|
||||||
call_deferred("free")
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
|
@ -1,35 +0,0 @@
|
||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="StreamTexture"
|
|
||||||
path="res://.import/fireball.png-cd7388e1024202929d5484e59b923c94.stex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://src/models/fireball/fireball.png"
|
|
||||||
dest_files=[ "res://.import/fireball.png-cd7388e1024202929d5484e59b923c94.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
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
stream=false
|
|
||||||
size_limit=0
|
|
||||||
detect_3d=false
|
|
||||||
svg/scale=1.0
|
|
|
@ -5,10 +5,10 @@
|
||||||
[ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3]
|
[ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 4, 4 )
|
extents = Vector2( 3.5, 3.5 )
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=2]
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
extents = Vector2( 7, 11 )
|
extents = Vector2( 3.5, 9 )
|
||||||
|
|
||||||
[sub_resource type="Animation" id=4]
|
[sub_resource type="Animation" id=4]
|
||||||
resource_name = "RESET"
|
resource_name = "RESET"
|
||||||
|
@ -48,7 +48,7 @@ tracks/0/loop_wrap = true
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PoolRealArray( 0, 0.9 ),
|
"times": PoolRealArray( 0, 2 ),
|
||||||
"transitions": PoolRealArray( 1, 1 ),
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ true, false ]
|
"values": [ true, false ]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
extends KinematicBody2D
|
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 bullet_preload = preload("res://src/models/bullet/Bullet.tscn")
|
||||||
var outline_material = load("res://res/shaders/outline_material.tres")
|
var outline_material = load("res://res/shaders/outline_material.tres")
|
||||||
var speed_multiplier: float = 1.0
|
var speed_multiplier: float = 1.0
|
||||||
|
@ -72,12 +71,6 @@ func _shoot():
|
||||||
bullet.global_position.x = self.global_position.x + 8
|
bullet.global_position.x = self.global_position.x + 8
|
||||||
bullet.global_position.y = self.global_position.y + 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
|
|
||||||
|
|
||||||
func _draw():
|
func _draw():
|
||||||
if target != null and is_instance_valid(target):
|
if target != null and is_instance_valid(target):
|
||||||
var dist2enemy = position.distance_to(target.global_position)
|
var dist2enemy = position.distance_to(target.global_position)
|
||||||
|
@ -86,8 +79,6 @@ func _draw():
|
||||||
mob_offset = Vector2(8, 7)
|
mob_offset = Vector2(8, 7)
|
||||||
if target.is_in_group("ghost"):
|
if target.is_in_group("ghost"):
|
||||||
mob_offset = Vector2(8, 12)
|
mob_offset = Vector2(8, 12)
|
||||||
if target.is_in_group("rat"):
|
|
||||||
mob_offset = Vector2(14, 6)
|
|
||||||
draw_dashed_line(Vector2(12, 12), target.global_position - self.global_position + mob_offset, Color("ffde00"), 1)
|
draw_dashed_line(Vector2(12, 12), target.global_position - self.global_position + mob_offset, Color("ffde00"), 1)
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[gd_scene load_steps=17 format=2]
|
[gd_scene load_steps=21 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/scenes/menu/background/background.png" type="Texture" id=1]
|
[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]
|
[ext_resource path="res://src/scenes/game/sprites/background_houses.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://src/scenes/game/spell_holder.gd" type="Script" id=3]
|
[ext_resource path="res://src/scenes/game/spell_holder.gd" type="Script" id=3]
|
||||||
[ext_resource path="res://res/themes/8px.tres" type="Theme" id=4]
|
[ext_resource path="res://res/fonts/silkscreen/Silkscreen-Regular.ttf" type="DynamicFontData" id=4]
|
||||||
[ext_resource path="res://src/models/player/Player.tscn" type="PackedScene" id=5]
|
[ext_resource path="res://src/models/player/Player.tscn" type="PackedScene" id=5]
|
||||||
[ext_resource path="res://src/scenes/game/sprites/health/3.png" type="Texture" id=6]
|
[ext_resource path="res://src/scenes/game/sprites/health/3.png" type="Texture" id=6]
|
||||||
[ext_resource path="res://src/scenes/game/sprites/health/1.png" type="Texture" id=7]
|
[ext_resource path="res://src/scenes/game/sprites/health/1.png" type="Texture" id=7]
|
||||||
|
@ -12,6 +12,9 @@
|
||||||
[ext_resource path="res://src/scenes/game/sprites/player_icon.png" type="Texture" id=10]
|
[ext_resource path="res://src/scenes/game/sprites/player_icon.png" type="Texture" id=10]
|
||||||
[ext_resource path="res://src/scenes/game/game.gd" type="Script" id=11]
|
[ext_resource path="res://src/scenes/game/game.gd" type="Script" id=11]
|
||||||
[ext_resource path="res://src/scenes/game/sprites/ui_background.png" type="Texture" id=12]
|
[ext_resource path="res://src/scenes/game/sprites/ui_background.png" type="Texture" id=12]
|
||||||
|
[ext_resource path="res://src/models/enemies/trash_can/TrashCan.tscn" type="PackedScene" id=13]
|
||||||
|
[ext_resource path="res://src/models/enemies/bat/Bat.tscn" type="PackedScene" id=14]
|
||||||
|
[ext_resource path="res://src/models/enemies/ghost/Ghost.tscn" type="PackedScene" id=15]
|
||||||
[ext_resource path="res://src/scenes/game/spell_recharge_bar.gd" type="Script" id=16]
|
[ext_resource path="res://src/scenes/game/spell_recharge_bar.gd" type="Script" id=16]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=2]
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
|
@ -20,6 +23,10 @@ extents = Vector2( 10, 60 )
|
||||||
[sub_resource type="RectangleShape2D" id=3]
|
[sub_resource type="RectangleShape2D" id=3]
|
||||||
extents = Vector2( 140, 10.125 )
|
extents = Vector2( 140, 10.125 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=1]
|
||||||
|
size = 8
|
||||||
|
font_data = ExtResource( 4 )
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=4]
|
[sub_resource type="SpriteFrames" id=4]
|
||||||
animations = [ {
|
animations = [ {
|
||||||
"frames": [ ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 6 ) ],
|
"frames": [ ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 6 ) ],
|
||||||
|
@ -71,6 +78,16 @@ z_index = 1
|
||||||
|
|
||||||
[node name="Enemies" type="Node2D" parent="View"]
|
[node name="Enemies" type="Node2D" parent="View"]
|
||||||
|
|
||||||
|
[node name="TrashCan" parent="View/Enemies" instance=ExtResource( 13 )]
|
||||||
|
|
||||||
|
[node name="Bat" parent="View/Enemies" instance=ExtResource( 14 )]
|
||||||
|
|
||||||
|
[node name="Bat2" parent="View/Enemies" instance=ExtResource( 14 )]
|
||||||
|
position = Vector2( 142, 54 )
|
||||||
|
|
||||||
|
[node name="Ghost" parent="View/Enemies" instance=ExtResource( 15 )]
|
||||||
|
position = Vector2( 509, 100 )
|
||||||
|
|
||||||
[node name="CPUParticles2D" type="CPUParticles2D" parent="View"]
|
[node name="CPUParticles2D" type="CPUParticles2D" parent="View"]
|
||||||
position = Vector2( 160, 90 )
|
position = Vector2( 160, 90 )
|
||||||
amount = 9
|
amount = 9
|
||||||
|
@ -97,65 +114,43 @@ margin_bottom = 180.0
|
||||||
texture = ExtResource( 12 )
|
texture = ExtResource( 12 )
|
||||||
expand = true
|
expand = true
|
||||||
|
|
||||||
[node name="LevelProgressBar" type="Control" parent="UIWrapper/UI"]
|
[node name="SpellHolder" type="Control" parent="UIWrapper/UI"]
|
||||||
margin_left = 10.0
|
|
||||||
margin_top = 126.0
|
|
||||||
margin_right = 310.0
|
|
||||||
margin_bottom = 128.0
|
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="UIWrapper/UI/LevelProgressBar"]
|
|
||||||
margin_right = 300.0
|
|
||||||
margin_bottom = 2.0
|
|
||||||
|
|
||||||
[node name="Left" type="Control" parent="UIWrapper/UI"]
|
|
||||||
margin_right = 40.0
|
|
||||||
margin_bottom = 40.0
|
|
||||||
|
|
||||||
[node name="Health" type="Control" parent="UIWrapper/UI/Left"]
|
|
||||||
margin_right = 40.0
|
|
||||||
margin_bottom = 40.0
|
|
||||||
|
|
||||||
[node name="HealthSprite" type="AnimatedSprite" parent="UIWrapper/UI/Left/Health"]
|
|
||||||
position = Vector2( 52, 148 )
|
|
||||||
frames = SubResource( 4 )
|
|
||||||
frame = 3
|
|
||||||
centered = false
|
|
||||||
|
|
||||||
[node name="PlayerIcon" type="Sprite" parent="UIWrapper/UI/Left"]
|
|
||||||
position = Vector2( 10, 136 )
|
|
||||||
texture = ExtResource( 10 )
|
|
||||||
centered = false
|
|
||||||
|
|
||||||
[node name="Center" type="Control" parent="UIWrapper/UI"]
|
|
||||||
margin_right = 40.0
|
|
||||||
margin_bottom = 40.0
|
|
||||||
|
|
||||||
[node name="SpellHolder" type="Control" parent="UIWrapper/UI/Center"]
|
|
||||||
margin_left = 120.0
|
margin_left = 120.0
|
||||||
margin_top = 145.0
|
margin_top = 145.0
|
||||||
margin_right = 200.0
|
margin_right = 200.0
|
||||||
margin_bottom = 159.0
|
margin_bottom = 159.0
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="Text" type="Label" parent="UIWrapper/UI/Center/SpellHolder"]
|
[node name="Text" type="Label" parent="UIWrapper/UI/SpellHolder"]
|
||||||
margin_left = 1.0
|
margin_left = 1.0
|
||||||
margin_top = -14.0
|
margin_top = -14.0
|
||||||
margin_right = 79.0
|
margin_right = 79.0
|
||||||
margin_bottom = 7.0
|
margin_bottom = 7.0
|
||||||
theme = ExtResource( 4 )
|
custom_fonts/font = SubResource( 1 )
|
||||||
text = "spell modifiers"
|
text = "spell modifiers"
|
||||||
|
|
||||||
[node name="SpellRechargeBar" type="Control" parent="UIWrapper/UI/Center"]
|
[node name="Health" type="Control" parent="UIWrapper/UI"]
|
||||||
|
margin_right = 40.0
|
||||||
|
margin_bottom = 40.0
|
||||||
|
|
||||||
|
[node name="HealthSprite" type="AnimatedSprite" parent="UIWrapper/UI/Health"]
|
||||||
|
position = Vector2( 70, 145 )
|
||||||
|
frames = SubResource( 4 )
|
||||||
|
frame = 2
|
||||||
|
centered = false
|
||||||
|
|
||||||
|
[node name="SpellRechargeBar" type="Control" parent="UIWrapper/UI"]
|
||||||
margin_left = 120.0
|
margin_left = 120.0
|
||||||
margin_top = 162.0
|
margin_top = 162.0
|
||||||
margin_right = 200.0
|
margin_right = 200.0
|
||||||
margin_bottom = 165.0
|
margin_bottom = 165.0
|
||||||
script = ExtResource( 16 )
|
script = ExtResource( 16 )
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="UIWrapper/UI/Center/SpellRechargeBar"]
|
[node name="ColorRect" type="ColorRect" parent="UIWrapper/UI/SpellRechargeBar"]
|
||||||
margin_right = 80.0
|
margin_right = 80.0
|
||||||
margin_bottom = 3.0
|
margin_bottom = 3.0
|
||||||
|
|
||||||
[node name="Right" type="Control" parent="UIWrapper/UI"]
|
[node name="PlayerIcon" type="Sprite" parent="UIWrapper/UI"]
|
||||||
margin_right = 40.0
|
position = Vector2( 20, 134 )
|
||||||
margin_bottom = 40.0
|
texture = ExtResource( 10 )
|
||||||
|
centered = false
|
||||||
|
|
|
@ -1,38 +1,5 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
var difficulty = 0
|
|
||||||
var last_diff = 0
|
|
||||||
var mob_preloads = [
|
|
||||||
preload("res://src/models/enemies/rat/Rat.tscn"),
|
|
||||||
preload("res://src/models/enemies/bat/Bat.tscn"),
|
|
||||||
preload("res://src/models/enemies/trash_can/TrashCan.tscn"),
|
|
||||||
preload("res://src/models/enemies/ghost/Ghost.tscn"),
|
|
||||||
]
|
|
||||||
var mob_timers = [.0, .0, .0, .0]
|
|
||||||
var mob_threshold = [5, 7, 10, 7]
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Global.play_time = .0
|
|
||||||
Global.health = 3
|
Global.health = 3
|
||||||
Global.add_health(0)
|
Global.add_health(0)
|
||||||
|
|
||||||
func pause():
|
|
||||||
Global.playing = false
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
|
||||||
if Global.playing:
|
|
||||||
Global.play_time += delta
|
|
||||||
|
|
||||||
difficulty = int(Global.play_time / 60)
|
|
||||||
if difficulty != last_diff:
|
|
||||||
last_diff = difficulty
|
|
||||||
# TODO perk selection
|
|
||||||
|
|
||||||
$UIWrapper/UI/LevelProgressBar/ColorRect.rect_size.x = (Global.play_time - difficulty * 60) / 60.0 * 300
|
|
||||||
|
|
||||||
for i in range(clamp(difficulty + 1, 1, 4)):
|
|
||||||
mob_timers[i] += delta
|
|
||||||
if mob_timers[i] >= mob_threshold[i]:
|
|
||||||
mob_timers[i] = .0
|
|
||||||
var mob_instance = mob_preloads[i].instance()
|
|
||||||
$View/Enemies.add_child(mob_instance)
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ var GAME_SCENE = preload("res://src/scenes/game/Game.tscn")
|
||||||
var MENU_SCENE = preload("res://src/scenes/menu/Menu.tscn")
|
var MENU_SCENE = preload("res://src/scenes/menu/Menu.tscn")
|
||||||
|
|
||||||
var playing = true
|
var playing = true
|
||||||
var play_time = .0
|
|
||||||
var health = 2
|
var health = 2
|
||||||
|
|
||||||
func game_start():
|
func game_start():
|
||||||
|
|
Loading…
Reference in New Issue