You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
640 B
27 lines
640 B
extends Node2D |
|
onready var player = get_parent().get_node("Player") |
|
|
|
# Declare member variables here. Examples: |
|
# var a = 2 |
|
# var b = "text" |
|
|
|
|
|
# Called when the node enters the scene tree for the first time. |
|
func _ready(): |
|
var covers = get_node("../Covers") |
|
covers.show() |
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame. |
|
func _process(delta): |
|
for i in range(5): |
|
var room = get_child(i) |
|
var furniture = get_node("../Furniture").get_child(i) |
|
var cover = get_node("../Covers").get_child(i) |
|
if(room.overlaps_body(player)): |
|
furniture.show() |
|
cover.hide() |
|
else: |
|
furniture.hide() |
|
cover.show() |
|
|
|
|