In game test pickup with resource package.
This commit is contained in:
parent
b9fd6bb3af
commit
8e8ec8e759
|
|
@ -5,11 +5,20 @@ extends Interactable
|
||||||
# Declare member variables here. Examples:
|
# Declare member variables here. Examples:
|
||||||
# var a = 2
|
# var a = 2
|
||||||
# var b = "text"
|
# var b = "text"
|
||||||
|
export var item :Resource
|
||||||
|
|
||||||
|
var item_sprite :AnimatedSprite
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
pass # Replace with function body.
|
assert( item is Item, "Proper Item resourse type not given " + self.name)
|
||||||
|
if item is Item:
|
||||||
|
item_sprite = AnimatedSprite.new()
|
||||||
|
item_sprite.frames = item.in_game_sprite
|
||||||
|
add_child(item_sprite)
|
||||||
|
item_sprite.play()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=12 format=2]
|
[gd_scene load_steps=15 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/templates/level_templates/LevelTemplate.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/templates/level_templates/LevelTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/levels/LegacyFantasy-High_Forest/tileset.tres" type="TileSet" id=2]
|
[ext_resource path="res://assets/levels/LegacyFantasy-High_Forest/tileset.tres" type="TileSet" id=2]
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
[ext_resource path="res://src/Interactables/LevelTransition.tscn" type="PackedScene" id=4]
|
[ext_resource path="res://src/Interactables/LevelTransition.tscn" type="PackedScene" id=4]
|
||||||
[ext_resource path="res://assets_tmp/Music/summer nights.ogg" type="AudioStream" id=5]
|
[ext_resource path="res://assets_tmp/Music/summer nights.ogg" type="AudioStream" id=5]
|
||||||
[ext_resource path="res://assets/UI/no_cam_tile.png" type="Texture" id=6]
|
[ext_resource path="res://assets/UI/no_cam_tile.png" type="Texture" id=6]
|
||||||
|
[ext_resource path="res://src/Interactables/ItemPickup.tscn" type="PackedScene" id=7]
|
||||||
|
[ext_resource path="res://assets/items/doodad.tres" type="Resource" id=8]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=1]
|
[sub_resource type="CircleShape2D" id=1]
|
||||||
radius = 5.09902
|
radius = 5.09902
|
||||||
|
|
@ -42,6 +44,8 @@ points = PoolVector2Array( 20, 20, 0.326027, 20, 0.326027, 0.605103, 20, 0.60510
|
||||||
} ]
|
} ]
|
||||||
0/z_index = 0
|
0/z_index = 0
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id=6]
|
||||||
|
|
||||||
[node name="TestBox" instance=ExtResource( 1 )]
|
[node name="TestBox" instance=ExtResource( 1 )]
|
||||||
music_track = ExtResource( 5 )
|
music_track = ExtResource( 5 )
|
||||||
|
|
||||||
|
|
@ -113,3 +117,11 @@ collision_layer = 256
|
||||||
collision_mask = 0
|
collision_mask = 0
|
||||||
format = 1
|
format = 1
|
||||||
tile_data = PoolIntArray( -65536, 0, 0, -65521, 0, 0, 65535, 0, 0, 524287, 0, 0, 589824, 0, 0, 589838, 0, 0 )
|
tile_data = PoolIntArray( -65536, 0, 0, -65521, 0, 0, 65535, 0, 0, 524287, 0, 0, 589824, 0, 0, 589838, 0, 0 )
|
||||||
|
|
||||||
|
[node name="ItemPickup" parent="." index="9" instance=ExtResource( 7 )]
|
||||||
|
position = Vector2( 203, 38 )
|
||||||
|
type_name = "item_pickup"
|
||||||
|
item = ExtResource( 8 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="ItemPickup" index="0"]
|
||||||
|
shape = SubResource( 6 )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user