clegg
This commit is contained in:
commit
6a269eb236
97 changed files with 2137 additions and 0 deletions
1
objects/player/jet_particles.gd
Normal file
1
objects/player/jet_particles.gd
Normal file
|
@ -0,0 +1 @@
|
|||
extends CPUParticles2D
|
1
objects/player/jet_particles.gd.uid
Normal file
1
objects/player/jet_particles.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://nvpkqa3y8g04
|
27
objects/player/jet_particles.tscn
Normal file
27
objects/player/jet_particles.tscn
Normal file
|
@ -0,0 +1,27 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://dmg28km10q5ja"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cd68hj3p7r01q" path="res://sprites/particles/fire_particles.png" id="1_idk12"]
|
||||
[ext_resource type="Script" uid="uid://nvpkqa3y8g04" path="res://objects/player/jet_particles.gd" id="2_vu77f"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_idk12"]
|
||||
_limits = [0.0, 3.0, 0.0, 1.0]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 3), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_m4kly"]
|
||||
offsets = PackedFloat32Array(0.146667, 0.526667, 0.806667, 1)
|
||||
colors = PackedColorArray(0.580392, 0.768627, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0.321569, 0)
|
||||
|
||||
[node name="CPUParticles2D" type="CPUParticles2D" groups=["fire_particles"]]
|
||||
amount = 16
|
||||
texture = ExtResource("1_idk12")
|
||||
lifetime = 0.24
|
||||
local_coords = true
|
||||
spread = 0.0
|
||||
gravity = Vector2(-190, 980)
|
||||
tangential_accel_max = 100.0
|
||||
damping_max = 100.0
|
||||
angle_min = -720.0
|
||||
scale_amount_curve = SubResource("Curve_idk12")
|
||||
color_ramp = SubResource("Gradient_m4kly")
|
||||
script = ExtResource("2_vu77f")
|
27
objects/player/jet_particles_weak.tscn
Normal file
27
objects/player/jet_particles_weak.tscn
Normal file
|
@ -0,0 +1,27 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://c4dkexe3l6cma"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cd68hj3p7r01q" path="res://sprites/particles/fire_particles.png" id="1_gl2g5"]
|
||||
[ext_resource type="Script" uid="uid://nvpkqa3y8g04" path="res://objects/player/jet_particles.gd" id="2_td2pe"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_idk12"]
|
||||
_limits = [0.0, 3.0, 0.0, 1.0]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 3), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_m4kly"]
|
||||
offsets = PackedFloat32Array(0.453333, 0.806667, 0.873333, 1)
|
||||
colors = PackedColorArray(0.580392, 0.768627, 1, 1, 1, 0.839216, 0.215686, 1, 1, 0, 0, 1, 1, 0, 0.321569, 0)
|
||||
|
||||
[node name="CPUParticles2D" type="CPUParticles2D" groups=["fire_particles"]]
|
||||
amount = 16
|
||||
texture = ExtResource("1_gl2g5")
|
||||
lifetime = 0.15
|
||||
local_coords = true
|
||||
spread = 0.0
|
||||
gravity = Vector2(-190, 980)
|
||||
tangential_accel_max = 100.0
|
||||
damping_max = 100.0
|
||||
angle_min = -720.0
|
||||
scale_amount_curve = SubResource("Curve_idk12")
|
||||
color_ramp = SubResource("Gradient_m4kly")
|
||||
script = ExtResource("2_td2pe")
|
139
objects/player/player.gd
Normal file
139
objects/player/player.gd
Normal file
|
@ -0,0 +1,139 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
const WALK_ACCEL = 50.0
|
||||
const WALK_TOPSPEED = 160.0
|
||||
|
||||
const FLY_ACCEL = 50.0
|
||||
const FLY_TOPSPEED = 200.0
|
||||
|
||||
const GRAVITY = 15.0
|
||||
const FAST_FALL_VELOCITY = 500.0
|
||||
|
||||
var downward_velocity = 0.0
|
||||
var max_downward_velocity = 1200.0
|
||||
var fast_fall_max_downward_velocity = 1500.0
|
||||
|
||||
var fuel = 100.0
|
||||
const jetpack_velocity = 10.0
|
||||
|
||||
var score = 0
|
||||
|
||||
var aim_direction = 1
|
||||
|
||||
const BULLET = preload("res://weapons/spreadshot/spread_shot.tscn")
|
||||
const GRAZE_PARTICLES = preload("res://sprites/Player/graze_particles.tscn")
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var axis = Input.get_axis("ui_left","ui_right")
|
||||
if axis != 0: aim_direction = axis
|
||||
#region ground movement
|
||||
if axis != 0:
|
||||
if velocity.y < 0:
|
||||
move(FLY_ACCEL,FLY_TOPSPEED)
|
||||
else:
|
||||
move(WALK_ACCEL,WALK_TOPSPEED)
|
||||
if is_on_floor():
|
||||
%Sprite.play("walk")
|
||||
else:
|
||||
%Sprite.play("fly")
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, WALK_ACCEL)
|
||||
%Sprite.play("idle")
|
||||
#endregion
|
||||
#region gun
|
||||
if Input.is_action_just_pressed("shoot"):
|
||||
%ShootSound.play()
|
||||
var bullet = BULLET.instantiate()
|
||||
bullet.global_position = global_position
|
||||
get_parent().add_child(bullet)
|
||||
#endregion
|
||||
#region jetpack flight
|
||||
if Input.is_action_pressed("fly"):
|
||||
if fuel > 0.0:
|
||||
%Sprite.play("fly")
|
||||
fuel -= 40.0 * delta
|
||||
downward_velocity = 0.0
|
||||
if %JetpackSound.is_playing() == false: %JetpackSound.play()
|
||||
if %JetpackSound.pitch_scale < 1.25:
|
||||
%JetpackSound.pitch_scale += 0.4 * delta
|
||||
velocity.y -= jetpack_velocity
|
||||
emit_fire(true)
|
||||
|
||||
else:
|
||||
emit_fire(false)
|
||||
else:
|
||||
if %JetpackSound.pitch_scale > 0.4:
|
||||
%JetpackSound.pitch_scale -= 0.1 * delta
|
||||
emit_fire(false)
|
||||
|
||||
#endregion
|
||||
if is_on_floor():
|
||||
downward_velocity = 0.0
|
||||
GlobalFunctions.append_score()
|
||||
fuel = 100.0
|
||||
silence_jetpack(delta)
|
||||
else:
|
||||
if Input.is_action_pressed("fast_fall"):
|
||||
silence_jetpack(delta)
|
||||
else:
|
||||
%JetpackSound.volume_db = 0.0
|
||||
|
||||
if Input.is_action_pressed("fast_fall"):
|
||||
downward_velocity += FAST_FALL_VELOCITY
|
||||
downward_velocity = clamp(downward_velocity,0.0,fast_fall_max_downward_velocity)
|
||||
velocity.y = clamp(velocity.y,velocity.y,fast_fall_max_downward_velocity)
|
||||
else:
|
||||
downward_velocity += GRAVITY
|
||||
downward_velocity = clamp(downward_velocity,0.0,max_downward_velocity)
|
||||
velocity.y = clamp(velocity.y,velocity.y,max_downward_velocity)
|
||||
fuel -= 1 * delta
|
||||
|
||||
|
||||
|
||||
#jetpack pitch
|
||||
|
||||
velocity.y += downward_velocity * delta
|
||||
move_and_slide()
|
||||
#if event.is_action_pressed()
|
||||
#endregion
|
||||
|
||||
|
||||
func move(acceleration,topspeed):
|
||||
var axis = Input.get_axis("ui_left","ui_right")
|
||||
velocity.x += (axis * acceleration)
|
||||
%Sprite.scale.x = axis
|
||||
velocity.x = clamp(velocity.x,-topspeed,topspeed)
|
||||
|
||||
func silence_jetpack(delta):
|
||||
%JetpackSound.pitch_scale = 1.0
|
||||
%JetpackSound.volume_db -= 50 * delta
|
||||
|
||||
func emit_fire(emit:bool=true,lifetime:float=0.24):
|
||||
get_tree().get_nodes_in_group("fire_particles")[0].emitting = emit
|
||||
get_tree().get_nodes_in_group("fire_particles")[0].lifetime = lifetime
|
||||
get_tree().get_nodes_in_group("fire_particles")[1].emitting = emit
|
||||
get_tree().get_nodes_in_group("fire_particles")[1].lifetime = lifetime
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
if body.is_in_group("death"):
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
func _on_area_2d_area_entered(area: Area2D) -> void:
|
||||
#if area.is_in_group("death") or area.is_in_group("hurt"):
|
||||
#get_tree().reload_current_scene()
|
||||
pass
|
||||
|
||||
|
||||
func _on_hurtbox_area_entered(area: Area2D) -> void:
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
func _on_graze_hitbox_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("enemy_bullet"):
|
||||
if area.get_parent().grazed == false:
|
||||
GlobalFunctions.queue_score(0)
|
||||
var graze_particle = GRAZE_PARTICLES.instantiate()
|
||||
graze_particle.global_position = global_position
|
||||
get_parent().add_child(graze_particle)
|
||||
area.get_parent().grazed = true
|
1
objects/player/player.gd.uid
Normal file
1
objects/player/player.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cgo3kf4b37lx7
|
137
objects/player/player.tscn
Normal file
137
objects/player/player.tscn
Normal file
|
@ -0,0 +1,137 @@
|
|||
[gd_scene load_steps=15 format=3 uid="uid://e2tevu6gn5si"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cgo3kf4b37lx7" path="res://objects/player/player.gd" id="1_4flbx"]
|
||||
[ext_resource type="AudioStream" uid="uid://bhy8i7yg863n3" path="res://audio/sfx/jetpack.ogg" id="2_g7ett"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt2xuy2ihej2q" path="res://sprites/Player/clegg_fly.png" id="2_xkryw"]
|
||||
[ext_resource type="AudioStream" uid="uid://ct82ub5u2uoly" path="res://audio/sfx/se_g2.ogg" id="3_ssrue"]
|
||||
[ext_resource type="Texture2D" uid="uid://bi6gfgt0b0voa" path="res://sprites/Player/clegg.png" id="4_m4kly"]
|
||||
[ext_resource type="Texture2D" uid="uid://bce74ak1by42t" path="res://sprites/Player/clegg_walk1.png" id="4_xgwla"]
|
||||
[ext_resource type="Texture2D" uid="uid://bvb5neqj421p" path="res://sprites/Player/clegg_walk2.png" id="5_bi5m7"]
|
||||
[ext_resource type="AudioStream" uid="uid://bv6v7v5dtvoii" path="res://audio/sfx/graze.wav" id="6_ow0dq"]
|
||||
[ext_resource type="PackedScene" uid="uid://dmg28km10q5ja" path="res://objects/player/jet_particles.tscn" id="9_xgwla"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_xgwla"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_xkryw")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fly",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_m4kly")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 15.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_m4kly")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"new_animation",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_xgwla")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_m4kly")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_bi5m7")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 15.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sh265"]
|
||||
size = Vector2(28, 34.375)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cqmt1"]
|
||||
size = Vector2(27.5, 34)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_xkryw"]
|
||||
radius = 17.0
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_xgwla"]
|
||||
radius = 2.06155
|
||||
|
||||
[node name="Player" type="CharacterBody2D" groups=["player", "player_hitbox"]]
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_4flbx")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
visible = false
|
||||
offset_left = -8.0
|
||||
offset_top = -16.0
|
||||
offset_right = 8.0
|
||||
offset_bottom = 16.0
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
sprite_frames = SubResource("SpriteFrames_xgwla")
|
||||
animation = &"fly"
|
||||
|
||||
[node name="CPUParticles2D" parent="Sprite" instance=ExtResource("9_xgwla")]
|
||||
position = Vector2(-6, 17)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
[node name="CPUParticles2D2" parent="Sprite" instance=ExtResource("9_xgwla")]
|
||||
position = Vector2(2.5, 17)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -0.1875)
|
||||
shape = SubResource("RectangleShape2D_sh265")
|
||||
|
||||
[node name="Collectionbox" type="Area2D" parent="." groups=["player_hitbox"]]
|
||||
collision_mask = 7
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Collectionbox"]
|
||||
position = Vector2(0.25, 0)
|
||||
shape = SubResource("RectangleShape2D_cqmt1")
|
||||
|
||||
[node name="JetpackSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("2_g7ett")
|
||||
bus = &"Jetpack"
|
||||
|
||||
[node name="GrazeSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("6_ow0dq")
|
||||
|
||||
[node name="ShootSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("3_ssrue")
|
||||
volume_db = 6.559
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="GrazeHitbox" type="Area2D" parent="."]
|
||||
position = Vector2(-3, -4)
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GrazeHitbox"]
|
||||
position = Vector2(3, 4)
|
||||
shape = SubResource("CircleShape2D_xkryw")
|
||||
debug_color = Color(0.797602, 0.0486606, 1, 0.42)
|
||||
|
||||
[node name="Hurtbox" type="Area2D" parent="."]
|
||||
position = Vector2(-1, -10)
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"]
|
||||
position = Vector2(2, 11.5)
|
||||
shape = SubResource("CircleShape2D_xgwla")
|
||||
debug_color = Color(1, 0, 0.0917967, 0.42)
|
||||
|
||||
[connection signal="area_entered" from="Collectionbox" to="." method="_on_area_2d_area_entered"]
|
||||
[connection signal="body_entered" from="Collectionbox" to="." method="_on_area_2d_body_entered"]
|
||||
[connection signal="area_entered" from="GrazeHitbox" to="." method="_on_graze_hitbox_area_entered"]
|
||||
[connection signal="area_entered" from="Hurtbox" to="." method="_on_hurtbox_area_entered"]
|
29
objects/player/player_bullet/player_bullet.gd
Normal file
29
objects/player/player_bullet/player_bullet.gd
Normal file
|
@ -0,0 +1,29 @@
|
|||
extends Node2D
|
||||
|
||||
var direction = 1
|
||||
@export var speed = Vector2.ZERO
|
||||
@export var range = 1.0
|
||||
@export var infinite_range = true
|
||||
|
||||
func _ready() -> void:
|
||||
var player = get_tree().get_nodes_in_group("player")[0]
|
||||
direction = player.aim_direction
|
||||
if infinite_range == true: %RangeTimer.paused = true
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position.x += (speed.x * direction) * delta
|
||||
position.y += (speed.y) * delta
|
||||
|
||||
|
||||
func _on_area_2d_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("enemy_hitbox"):
|
||||
GlobalFunctions.queue_score(10)
|
||||
area.get_parent().queue_free()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
queue_free()
|
||||
|
||||
func _on_range_timer_timeout() -> void:
|
||||
queue_free()
|
1
objects/player/player_bullet/player_bullet.gd.uid
Normal file
1
objects/player/player_bullet/player_bullet.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cbmi6g10hnfve
|
31
objects/player/player_bullet/player_bullet.tscn
Normal file
31
objects/player/player_bullet/player_bullet.tscn
Normal file
|
@ -0,0 +1,31 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://cqqqblpc3j4hn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbmi6g10hnfve" path="res://objects/player/player_bullet/player_bullet.gd" id="1_lj6op"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_lj6op"]
|
||||
size = Vector2(8, 8)
|
||||
|
||||
[node name="PlayerBullet" type="Node2D"]
|
||||
script = ExtResource("1_lj6op")
|
||||
speed = Vector2(1000, 0)
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
offset_left = -4.0
|
||||
offset_top = -4.0
|
||||
offset_right = 4.0
|
||||
offset_bottom = 4.0
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 16
|
||||
collision_mask = 14
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("RectangleShape2D_lj6op")
|
||||
|
||||
[node name="RangeTimer" type="Timer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||
[connection signal="timeout" from="RangeTimer" to="." method="_on_range_timer_timeout"]
|
12
objects/scoreitem/scoreitem.gd
Normal file
12
objects/scoreitem/scoreitem.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends Node2D
|
||||
|
||||
@export var score = 0
|
||||
const PARTICLES = preload("res://objects/scoreitem/scoreitem_particles.tscn")
|
||||
|
||||
func _on_area_2d_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("player_hitbox"):
|
||||
GlobalFunctions.queue_score(score)
|
||||
var particles = PARTICLES.instantiate()
|
||||
particles.global_position = global_position
|
||||
get_owner().add_child(particles)
|
||||
queue_free()
|
1
objects/scoreitem/scoreitem.gd.uid
Normal file
1
objects/scoreitem/scoreitem.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://8wiyfiyykh6t
|
56
objects/scoreitem/scoreitem.tscn
Normal file
56
objects/scoreitem/scoreitem.tscn
Normal file
|
@ -0,0 +1,56 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://bskdt3t8fae6m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://8wiyfiyykh6t" path="res://objects/scoreitem/scoreitem.gd" id="1_8u3vk"]
|
||||
[ext_resource type="Texture2D" uid="uid://dr1uub2l0vdh4" path="res://sprites/screw/0c575d08-e62d-4013-9e08-172d0662fcda.png" id="1_e6x4u"]
|
||||
[ext_resource type="Texture2D" uid="uid://csqvymhme5h8t" path="res://sprites/screw/23b869e4-5707-44a8-8bbc-a788d5c71275.png" id="2_8u3vk"]
|
||||
[ext_resource type="Texture2D" uid="uid://bptdaaemdeqt" path="res://sprites/screw/6ca66360-a47d-4690-88f8-b9c160416be3.png" id="3_oad3k"]
|
||||
[ext_resource type="Texture2D" uid="uid://dud5u6ojbsupr" path="res://sprites/screw/72235a50-452c-4104-a5b4-447ee5c42785.png" id="4_e7vhn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dutm1rklnb33t" path="res://sprites/screw/30656deb-ca75-4981-8198-ad555b89764a.png" id="5_dfapo"]
|
||||
[ext_resource type="Texture2D" uid="uid://cvuhonmcq21hk" path="res://sprites/screw/c433a95b-a214-4bdd-b58e-8ef611c6be46.png" id="6_uywcb"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_dayts"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_e6x4u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_8u3vk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_oad3k")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_e7vhn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_dfapo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("6_uywcb")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 15.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_e6x4u"]
|
||||
size = Vector2(15, 15)
|
||||
|
||||
[node name="Scoreitem" type="Node2D"]
|
||||
script = ExtResource("1_8u3vk")
|
||||
score = 10
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
sprite_frames = SubResource("SpriteFrames_dayts")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.340073
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("RectangleShape2D_e6x4u")
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
7
objects/scoreitem/scoreitem_particles.gd
Normal file
7
objects/scoreitem/scoreitem_particles.gd
Normal file
|
@ -0,0 +1,7 @@
|
|||
extends CPUParticles2D
|
||||
|
||||
func _ready() -> void:
|
||||
emitting = true
|
||||
|
||||
func _on_finished() -> void:
|
||||
queue_free()
|
1
objects/scoreitem/scoreitem_particles.gd.uid
Normal file
1
objects/scoreitem/scoreitem_particles.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://bdcxqp8royr5u
|
32
objects/scoreitem/scoreitem_particles.tscn
Normal file
32
objects/scoreitem/scoreitem_particles.tscn
Normal file
|
@ -0,0 +1,32 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bsmmvt6hf6m5b"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bdcxqp8royr5u" path="res://objects/scoreitem/scoreitem_particles.gd" id="1_aeam7"]
|
||||
[ext_resource type="AudioStream" uid="uid://c7h4qdg8gtnhk" path="res://audio/sfx/key.ogg" id="2_rwya6"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_aeam7"]
|
||||
offsets = PackedFloat32Array(0, 0.513333, 1)
|
||||
colors = PackedColorArray(1, 0, 0, 1, 1, 1, 0.568627, 1, 1, 1, 1, 1)
|
||||
|
||||
[node name="CPUParticles2D" type="CPUParticles2D"]
|
||||
emitting = false
|
||||
amount = 38
|
||||
lifetime = 0.2
|
||||
one_shot = true
|
||||
speed_scale = 0.5
|
||||
explosiveness = 1.0
|
||||
randomness = 1.0
|
||||
lifetime_randomness = 1.0
|
||||
spread = 154.09
|
||||
gravity = Vector2(0, 630)
|
||||
initial_velocity_min = 251.99
|
||||
initial_velocity_max = 484.86
|
||||
scale_amount_min = 1.5
|
||||
scale_amount_max = 2.5
|
||||
color_ramp = SubResource("Gradient_aeam7")
|
||||
script = ExtResource("1_aeam7")
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("2_rwya6")
|
||||
autoplay = true
|
||||
|
||||
[connection signal="finished" from="." to="." method="_on_finished"]
|
Loading…
Add table
Add a link
Reference in a new issue