add some functions to fireball
This commit is contained in:
parent
14a253f36c
commit
3a39b6bffa
21
Fireball.gd
Normal file
21
Fireball.gd
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
extends Area2D
|
||||||
|
|
||||||
|
|
||||||
|
# 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():
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
move_local_x(delta * 400)
|
||||||
|
|
||||||
|
func _on_Fireball_area_entered(area):
|
||||||
|
if(area.get_collision_layer_bit(1)):
|
||||||
|
queue_free()
|
||||||
|
pass # Replace with function body.
|
@ -1,6 +1,7 @@
|
|||||||
[gd_scene load_steps=48 format=2]
|
[gd_scene load_steps=49 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/SPRITESHEET_Files/FireBall_2_64x64.png" type="Texture" id=1]
|
[ext_resource path="res://assets/SPRITESHEET_Files/FireBall_2_64x64.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://Fireball.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
flags = 4
|
flags = 4
|
||||||
@ -236,8 +237,12 @@ animations = [ {
|
|||||||
} ]
|
} ]
|
||||||
|
|
||||||
[node name="Fireball" type="Area2D"]
|
[node name="Fireball" type="Area2D"]
|
||||||
|
collision_layer = 9
|
||||||
|
collision_mask = 4
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
frames = SubResource( 46 )
|
frames = SubResource( 46 )
|
||||||
frame = 40
|
frame = 40
|
||||||
speed_scale = 15.0
|
speed_scale = 15.0
|
||||||
|
[connection signal="area_entered" from="." to="." method="_on_Fireball_area_entered"]
|
||||||
|
Loading…
Reference in New Issue
Block a user