Merge remote-tracking branch 'origin/master'

This commit is contained in:
Diego 2020-07-18 02:26:48 -05:00
commit a58e3fa0c8
11 changed files with 150 additions and 23 deletions

View file

@ -1,3 +0,0 @@
extends Node

View file

@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://art/Wand.png" type="Texture" id=1]
[ext_resource path="res://script/ItemPickup.gd" type="Script" id=2]
[sub_resource type="Animation" id=1]
resource_name = "Bounce"
length = 2.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Wand Pickup:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5, 1.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, 2 ), Vector2( 0, -2 ) ]
}
[sub_resource type="CircleShape2D" id=2]
radius = 9.05539
[node name="Area2D" type="Area2D"]
monitorable = false
collision_layer = 0
script = ExtResource( 2 )
[node name="Wand Pickup" type="Sprite" parent="."]
position = Vector2( 0, 0.853822 )
texture = ExtResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Bounce"
anims/Bounce = SubResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
[connection signal="body_entered" from="." to="." method="_on_Area2D_body_entered"]

View file

@ -1,10 +1,19 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://characters/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://meta/DungeonTilemap.tscn" type="PackedScene" id=2]
[ext_resource path="res://Items/Basic Wand Pickup.tscn" type="PackedScene" id=3]
[ext_resource path="res://art/Pedestal.png" type="Texture" id=4]
[node name="Node2D" type="Node2D"]
[node name="Pedestal" type="Sprite" parent="."]
position = Vector2( 98, 168 )
texture = ExtResource( 4 )
[node name="Wand Pickup" parent="Pedestal" instance=ExtResource( 3 )]
position = Vector2( 0, -12 )
[node name="Player" parent="." instance=ExtResource( 1 )]
position = Vector2( 60, 176 )

6
script/ItemPickup.gd Normal file
View file

@ -0,0 +1,6 @@
extends Area2D
export var Item: PackedScene
func _on_Area2D_body_entered(body):
print(body)

View file

@ -54,7 +54,6 @@ func _ready():
func _physics_process(delta):
Globals.player = position
print(Globals.player)
emit_signal("grounded_updated", is_on_floor())

BIN
ui/Inventory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

34
ui/Inventory.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Inventory.png-43b1effbb274feadb5a883f6a0af2730.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/Inventory.png"
dest_files=[ "res://.import/Inventory.png-43b1effbb274feadb5a883f6a0af2730.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

BIN
ui/Player UI Frame 2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Player UI Frame 2.png-ae7c7823c7da329b4570ee5d7763efe6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/Player UI Frame 2.png"
dest_files=[ "res://.import/Player UI Frame 2.png-ae7c7823c7da329b4570ee5d7763efe6.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

View file

@ -1,11 +1,11 @@
extends CanvasLayer
onready var Hearts: TextureProgress = $"Player UI Frame/Hearts"
onready var Energybar: TextureProgress = $"Player UI Frame/Energy"
onready var Hearts: TextureProgress = $"Player UI Frame 2/Hearts"
onready var Energybar: TextureProgress = $"Player UI Frame 2/Energy"
onready var Regen: Timer = $Regen
var health = 3 setget set_health, get_health
var energy = 0 setget set_energy, get_energy
var energy = 5 setget set_energy, get_energy
func _on_Regen_timeout():
set_energy(get_energy() + 1)

View file

@ -1,36 +1,43 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/PlayerStats.gd" type="Script" id=1]
[ext_resource path="res://ui/Player UI Frame.png" type="Texture" id=2]
[ext_resource path="res://ui/Player UI Frame 2.png" type="Texture" id=2]
[ext_resource path="res://ui/Hearts.png" type="Texture" id=3]
[ext_resource path="res://ui/Energy.png" type="Texture" id=4]
[node name="Stats" type="CanvasLayer"]
script = ExtResource( 1 )
[node name="Player UI Frame" type="Sprite" parent="."]
position = Vector2( 160, 171 )
[node name="Regen" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="Player UI Frame 2" type="Sprite" parent="."]
position = Vector2( 160, 170 )
texture = ExtResource( 2 )
[node name="Hearts" type="TextureProgress" parent="Player UI Frame"]
margin_left = -45.0
[node name="Hearts" type="TextureProgress" parent="Player UI Frame 2"]
margin_left = -47.0
margin_top = -6.0
margin_right = 2.0
margin_bottom = 6.0
max_value = 3.0
step = 0.5
value = 3.0
texture_progress = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Energy" type="TextureProgress" parent="Player UI Frame"]
margin_left = 6.0
margin_top = -5.0
margin_right = 44.0
margin_bottom = 4.0
[node name="Energy" type="TextureProgress" parent="Player UI Frame 2"]
margin_left = 4.0
margin_top = -4.99998
margin_right = 42.0
margin_bottom = 4.00002
max_value = 5.0
step = 1.0
value = 5.0
texture_progress = ExtResource( 4 )
[node name="Regen" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="timeout" from="Regen" to="." method="_on_Regen_timeout"]