Fix collision generation issues
This commit is contained in:
parent
a267be20ac
commit
d9350f3f6d
@ -51,6 +51,7 @@ func _process(delta):
|
|||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="LoadingScreen" type="CanvasLayer" parent="."]
|
[node name="LoadingScreen" type="CanvasLayer" parent="."]
|
||||||
|
editor/display_folded = true
|
||||||
script = SubResource( 1 )
|
script = SubResource( 1 )
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="LoadingScreen"]
|
[node name="ColorRect" type="ColorRect" parent="LoadingScreen"]
|
||||||
|
8
Nodes/Pickup.gd
Normal file
8
Nodes/Pickup.gd
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
var tileMap
|
||||||
|
func _ready():
|
||||||
|
var tileMap = get_node("/root/World/TileMap")
|
||||||
|
var tilePos = tileMap.world_to_map(position)
|
||||||
|
if(tileMap.get_cell(tilePos.x, tilePos.y) != 0):
|
||||||
|
queue_free()
|
@ -1,7 +1,8 @@
|
|||||||
[gd_scene load_steps=6 format=2]
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Art/pickup1.png" type="Texture" id=1]
|
[ext_resource path="res://Nodes/Pickup.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Art/pickup2.png" type="Texture" id=2]
|
[ext_resource path="res://Art/pickup1.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://Art/pickup2.png" type="Texture" id=3]
|
||||||
|
|
||||||
[sub_resource type="GDScript" id=1]
|
[sub_resource type="GDScript" id=1]
|
||||||
script/source = "extends Area2D
|
script/source = "extends Area2D
|
||||||
@ -19,13 +20,14 @@ extents = Vector2( 6, 6 )
|
|||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=3]
|
[sub_resource type="SpriteFrames" id=3]
|
||||||
animations = [ {
|
animations = [ {
|
||||||
"frames": [ ExtResource( 1 ), ExtResource( 2 ) ],
|
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "default",
|
"name": "default",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[node name="Pickup" type="Node2D"]
|
[node name="Pickup" type="Node2D"]
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
gravity = 0.0
|
gravity = 0.0
|
||||||
|
@ -3,8 +3,12 @@ extends Node2D
|
|||||||
export var HP = 8
|
export var HP = 8
|
||||||
export var color = "ffff00"
|
export var color = "ffff00"
|
||||||
|
|
||||||
|
var tileMap
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
var tileMap = get_node("/root/World/TileMap")
|
||||||
|
var tilePos = tileMap.world_to_map(position)
|
||||||
|
if(tileMap.get_cell(tilePos.x, tilePos.y) != 0):
|
||||||
|
queue_free()
|
||||||
|
|
||||||
func take_damage(dmg):
|
func take_damage(dmg):
|
||||||
playAudio("Bomb_Drop.wav")
|
playAudio("Bomb_Drop.wav")
|
||||||
|
Loading…
Reference in New Issue
Block a user