Compare commits
No commits in common. "8fcb652f170aca16627854b8aa1c7eb24be8a358" and "a49d9b140ea57b041035970ea5cddbc2e306cb9e" have entirely different histories.
8fcb652f17
...
a49d9b140e
|
@ -3,6 +3,7 @@
|
|||
[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]
|
||||
|
|
|
@ -22,7 +22,6 @@ script = ExtResource( 2 )
|
|||
use_parent_material = true
|
||||
frames = ExtResource( 1 )
|
||||
animation = "idle"
|
||||
frame = 1
|
||||
playing = true
|
||||
centered = false
|
||||
|
||||
|
|
|
@ -48,12 +48,8 @@ func _physics_process(delta):
|
|||
$Sprite.global_position.y += sin(Time.get_ticks_msec() * 0.01) / 3
|
||||
|
||||
velocity *= speed * speed_multiplier
|
||||
if Global.playing:
|
||||
$Sprite.playing = true
|
||||
if not shooting:
|
||||
velocity = move_and_slide(velocity)
|
||||
else:
|
||||
$Sprite.playing = false
|
||||
if not shooting:
|
||||
velocity = move_and_slide(velocity)
|
||||
|
||||
func _shoot():
|
||||
sonic_wave = sonic_wave_preload.instance()
|
||||
|
|
|
@ -124,6 +124,7 @@ visible = false
|
|||
position = Vector2( 11, 2 )
|
||||
frames = ExtResource( 5 )
|
||||
animation = "idle"
|
||||
frame = 3
|
||||
playing = true
|
||||
|
||||
[node name="AudioGetDamage" type="AudioStreamPlayer" parent="."]
|
||||
|
|
|
@ -138,7 +138,7 @@ func _physics_process(delta):
|
|||
|
||||
choose_target()
|
||||
|
||||
if Global.playing and target != null and is_instance_valid(target) and not target.dead:
|
||||
if target != null and is_instance_valid(target) and not target.dead:
|
||||
target.material = outline_material
|
||||
|
||||
if recharge_timer >= get_recharge():
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
[ext_resource path="res://src/models/player/Player.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://src/scenes/game/sprites/health/health.png" type="Texture" id=6]
|
||||
[ext_resource path="res://src/scenes/game/sprites/cast_time.png" type="Texture" id=7]
|
||||
[ext_resource path="res://src/scenes/game/card_placeholder.gd" type="Script" id=8]
|
||||
[ext_resource path="res://src/scenes/game/sprites/damage.png" type="Texture" id=8]
|
||||
[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/sprites/ui_background.png" type="Texture" id=12]
|
||||
|
@ -29,14 +29,14 @@ extents = Vector2( 140, 10.125 )
|
|||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 155, 0, 31, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 124, 0, 31, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 93, 0, 31, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 124, 0, 31, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=10]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 62, 0, 31, 11 )
|
||||
|
@ -51,10 +51,10 @@ region = Rect2( 0, 0, 31, 11 )
|
|||
|
||||
[sub_resource type="SpriteFrames" id=4]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
"frames": [ SubResource( 7 ), SubResource( 9 ), SubResource( 8 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
|
||||
"loop": false,
|
||||
"name": "idle",
|
||||
"speed": 0.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
|
@ -155,12 +155,10 @@ color = Color( 0.133333, 0.133333, 0.137255, 1 )
|
|||
|
||||
[node name="UIWrapper" type="CanvasLayer" parent="."]
|
||||
layer = 3
|
||||
follow_viewport_enable = true
|
||||
|
||||
[node name="UI" type="Control" parent="UIWrapper"]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
mouse_filter = 2
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="Background" type="TextureRect" parent="UIWrapper/UI"]
|
||||
margin_top = 120.0
|
||||
|
@ -218,6 +216,7 @@ margin_bottom = 40.0
|
|||
[node name="HealthSprite" type="AnimatedSprite" parent="UIWrapper/UI/Left/Health"]
|
||||
position = Vector2( 52, 156 )
|
||||
frames = SubResource( 4 )
|
||||
animation = "idle"
|
||||
centered = false
|
||||
|
||||
[node name="PlayerIcon" type="Sprite" parent="UIWrapper/UI/Left"]
|
||||
|
@ -278,49 +277,40 @@ margin_bottom = 40.0
|
|||
|
||||
[node name="Damage" type="Sprite" parent="UIWrapper/UI/Right/Damage"]
|
||||
position = Vector2( 256, 160 )
|
||||
texture = ExtResource( 8 )
|
||||
|
||||
[node name="Cards" type="Control" parent="UIWrapper/UI"]
|
||||
visible = false
|
||||
margin_right = 320.0
|
||||
margin_bottom = 120.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="LeftPlaceholder" type="Control" parent="UIWrapper/UI/Cards" groups=["card_placeholder"]]
|
||||
[node name="LeftPlaceholder" type="Control" parent="UIWrapper/UI/Cards"]
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 102.0
|
||||
margin_bottom = 111.0
|
||||
mouse_filter = 1
|
||||
script = ExtResource( 8 )
|
||||
|
||||
[node name="Card" parent="UIWrapper/UI/Cards/LeftPlaceholder" instance=ExtResource( 18 )]
|
||||
|
||||
[node name="CenterPlaceholder" type="Control" parent="UIWrapper/UI/Cards" groups=["card_placeholder"]]
|
||||
[node name="CenterPlaceholder" type="Control" parent="UIWrapper/UI/Cards"]
|
||||
margin_left = 113.0
|
||||
margin_top = 8.0
|
||||
margin_right = 207.0
|
||||
margin_bottom = 111.0
|
||||
mouse_filter = 1
|
||||
script = ExtResource( 8 )
|
||||
id = 1
|
||||
|
||||
[node name="Card" parent="UIWrapper/UI/Cards/CenterPlaceholder" instance=ExtResource( 18 )]
|
||||
|
||||
[node name="RightPlaceholder" type="Control" parent="UIWrapper/UI/Cards" groups=["card_placeholder"]]
|
||||
[node name="RightPlaceholder" type="Control" parent="UIWrapper/UI/Cards"]
|
||||
margin_left = 218.0
|
||||
margin_top = 8.0
|
||||
margin_right = 312.0
|
||||
margin_bottom = 111.0
|
||||
mouse_filter = 1
|
||||
script = ExtResource( 8 )
|
||||
id = 2
|
||||
|
||||
[node name="Card" parent="UIWrapper/UI/Cards/RightPlaceholder" instance=ExtResource( 18 )]
|
||||
|
||||
[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 )
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
extends Control
|
||||
|
||||
export var id: int
|
||||
onready var game = get_tree().get_root().get_node("Game")
|
||||
|
||||
func _process(delta):
|
||||
if not Global.playing:
|
||||
if game.selected_card == null or game.selected_card == id:
|
||||
self.modulate = Color(1, 1, 1, 1)
|
||||
else:
|
||||
self.modulate = Color(0.2, 0.2, 0.2, 1)
|
||||
|
||||
func _ready():
|
||||
connect("mouse_entered", self, "select_hover", [self])
|
||||
|
||||
func select_hover(node):
|
||||
game.selected_card = id
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
extends Node
|
||||
|
||||
var selected_card = null
|
||||
var difficulty = 0
|
||||
var last_diff = 0
|
||||
var mob_preloads = [
|
||||
|
@ -18,14 +17,8 @@ func _ready():
|
|||
Global.health = 5
|
||||
Global.add_health(0)
|
||||
|
||||
func _input(event):
|
||||
if not Global.playing:
|
||||
if event is InputEventMouseButton:
|
||||
select_card()
|
||||
if event is InputEventMouseMotion:
|
||||
var pos = event.position
|
||||
if pos.x < 8 or pos.y < 8 or pos.x > 312 or pos.y > 112:
|
||||
selected_card = null
|
||||
func pause():
|
||||
Global.playing = false
|
||||
|
||||
func _physics_process(delta):
|
||||
if Global.playing:
|
||||
|
@ -36,10 +29,9 @@ func _physics_process(delta):
|
|||
Global.playing = false
|
||||
last_diff = difficulty
|
||||
var cards = range(8)
|
||||
for child in $UIWrapper/UI/Cards.get_children():
|
||||
for card_placeholder in $UIWrapper/UI/Cards.get_children():
|
||||
randomize()
|
||||
if child.is_in_group("card_placeholder"):
|
||||
child.get_node("Card").frame = cards.pop_at(randi()%cards.size())
|
||||
card_placeholder.get_node("Card").frame = cards.pop_at(randi()%cards.size())
|
||||
$UIWrapper/UI/Cards.visible = true
|
||||
|
||||
$UIWrapper/UI/LevelProgressBar/ColorRect.rect_size.x = (Global.play_time - difficulty * 60) / 60.0 * 300
|
||||
|
@ -51,8 +43,4 @@ func _physics_process(delta):
|
|||
mob_timers[i] = .0
|
||||
var mob_instance = mob_preloads[i].instance()
|
||||
$View/Enemies.add_child(mob_instance)
|
||||
|
||||
func select_card():
|
||||
if selected_card != null:
|
||||
Global.playing = true
|
||||
$UIWrapper/UI/Cards.visible = false
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
onready var player = $"../../Player"
|
||||
var empty_material = load("res://res/shaders/empty_material.tres")
|
||||
var empty_material = load("res://res/shaders/empty_material.tscn")
|
||||
var hp
|
||||
var dead = false
|
||||
var dead_timer = .0
|
||||
|
|
Loading…
Reference in New Issue