1
Fork 0
mirror of https://github.com/RYGhub/the-cold-night.git synced 2024-11-22 12:44:20 +00:00

Create ChangeFireIntensity pickup

This commit is contained in:
Steffo 2022-04-03 04:13:10 +02:00
parent 2b59dceada
commit e87b6e21d2
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,23 @@
extends Node
export var target_path: NodePath = NodePath("../../Fire")
export var amount_per_second: float = 0.2
onready var target = get_node(target_path)
onready var pickup: Area2D = get_parent()
var active = false
func _ready():
# warning-ignore: RETURN_VALUE_DISCARDED
pickup.connect("picked_up", self, "_on_picked_up")
func _on_picked_up():
active = true
func _process(delta):
if active:
target.intensity += delta * amount_per_second

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://src/entities/pickupeffects/ChangeFireIntensity.gd" type="Script" id=1]
[node name="ChangeFireIntensity" type="Node"]
script = ExtResource( 1 )