shape update
This commit is contained in:
parent
11a54f2b94
commit
2046fbff71
18 changed files with 467 additions and 46 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
16
Player.gd
16
Player.gd
|
@ -8,24 +8,20 @@ var exagon = preload("res://exagon.tscn")
|
||||||
var absolute_movement = false
|
var absolute_movement = false
|
||||||
var config = ConfigFile.new()
|
var config = ConfigFile.new()
|
||||||
|
|
||||||
const idle_anim = preload("res://player_idle.gif")
|
|
||||||
const moving_anim = preload("res://player_moving.gif")
|
|
||||||
var moving = false
|
var moving = false
|
||||||
|
var frozen = false
|
||||||
|
|
||||||
|
func update_animation():
|
||||||
|
pass
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
update_animation()
|
update_animation()
|
||||||
if config.load("user://settings.cfg") == OK:
|
if config.load("user://settings.cfg") == OK:
|
||||||
absolute_movement = not config.get_value("config", "relative_controls")
|
absolute_movement = not config.get_value("config", "relative_controls")
|
||||||
|
|
||||||
func update_animation():
|
|
||||||
if moving:
|
|
||||||
$AnimatedSprite2D.sprite_frames = moving_anim
|
|
||||||
else:
|
|
||||||
$AnimatedSprite2D.sprite_frames = idle_anim
|
|
||||||
|
|
||||||
$AnimatedSprite2D.play("gif")
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
|
if frozen:
|
||||||
|
return
|
||||||
look_at(get_global_mouse_position())
|
look_at(get_global_mouse_position())
|
||||||
var move_input = Input.get_axis("down", "up")
|
var move_input = Input.get_axis("down", "up")
|
||||||
var side_input = Input.get_axis("right", "left")
|
var side_input = Input.get_axis("right", "left")
|
||||||
|
|
|
@ -2,6 +2,8 @@ extends Node
|
||||||
|
|
||||||
var config = ConfigFile.new()
|
var config = ConfigFile.new()
|
||||||
|
|
||||||
|
const CHARACTERS = ["res://player-row.tscn", "res://player-apezoid.tscn"]
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
var has_config = config.load("user://settings.cfg") == OK
|
var has_config = config.load("user://settings.cfg") == OK
|
||||||
print(has_config)
|
print(has_config)
|
||||||
|
@ -20,6 +22,8 @@ func save():
|
||||||
config.set_value("config", "username", $Menu/Username.text)
|
config.set_value("config", "username", $Menu/Username.text)
|
||||||
config.set_value("config", "relative_controls", $Menu/Controls.selected == 0)
|
config.set_value("config", "relative_controls", $Menu/Controls.selected == 0)
|
||||||
|
|
||||||
|
config.set_value("gameplay", "class", CHARACTERS[$Menu/Character.selected])
|
||||||
|
|
||||||
print("Saving!")
|
print("Saving!")
|
||||||
config.save("user://settings.cfg")
|
config.save("user://settings.cfg")
|
||||||
$"../Layout/Play".disabled = false
|
$"../Layout/Play".disabled = false
|
||||||
|
|
BIN
apezoid-engine-idle.png
Normal file
BIN
apezoid-engine-idle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 367 B |
34
apezoid-engine-idle.png.import
Normal file
34
apezoid-engine-idle.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://1jurox63577w"
|
||||||
|
path="res://.godot/imported/apezoid-engine-idle.png-40d8ee663c6bbc960dadafb2aa1f5129.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://apezoid-engine-idle.png"
|
||||||
|
dest_files=["res://.godot/imported/apezoid-engine-idle.png-40d8ee663c6bbc960dadafb2aa1f5129.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
apezoid-gun.png
Normal file
BIN
apezoid-gun.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
34
apezoid-gun.png.import
Normal file
34
apezoid-gun.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://jc63jnpm7inw"
|
||||||
|
path="res://.godot/imported/apezoid-gun.png-55e37781c5dcb79b0687d824bbf6e32f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://apezoid-gun.png"
|
||||||
|
dest_files=["res://.godot/imported/apezoid-gun.png-55e37781c5dcb79b0687d824bbf6e32f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
apezoid_engine.png
Normal file
BIN
apezoid_engine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
34
apezoid_engine.png.import
Normal file
34
apezoid_engine.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://br5lt5658ioy3"
|
||||||
|
path="res://.godot/imported/apezoid_engine.png-66859c085fb6b7405d8ee72c12acdb72.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://apezoid_engine.png"
|
||||||
|
dest_files=["res://.godot/imported/apezoid_engine.png-66859c085fb6b7405d8ee72c12acdb72.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
14
main.gd
Normal file
14
main.gd
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
extends Node2D
|
||||||
|
var config = ConfigFile.new()
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
if config.load("user://settings.cfg") == OK:
|
||||||
|
var player = load(config.get_value("gameplay", "class", "res://player-row.tscn")).instantiate()
|
||||||
|
player.position = Vector2(1920/2, 1080/2)
|
||||||
|
add_child(player)
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
pass
|
11
main.tscn
11
main.tscn
|
@ -1,5 +1,6 @@
|
||||||
[gd_scene load_steps=110 format=3 uid="uid://bmd4m7lqj4v0x"]
|
[gd_scene load_steps=110 format=3 uid="uid://bmd4m7lqj4v0x"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://main.gd" id="1_3dydx"]
|
||||||
[ext_resource type="Script" path="res://Spawner.gd" id="1_ifu8g"]
|
[ext_resource type="Script" path="res://Spawner.gd" id="1_ifu8g"]
|
||||||
[ext_resource type="Script" path="res://GameManager.gd" id="1_k8sg3"]
|
[ext_resource type="Script" path="res://GameManager.gd" id="1_k8sg3"]
|
||||||
[ext_resource type="Resource" uid="uid://du12lm5aq7g7f" path="res://ircle_enemy.tres" id="3_xmk5u"]
|
[ext_resource type="Resource" uid="uid://du12lm5aq7g7f" path="res://ircle_enemy.tres" id="3_xmk5u"]
|
||||||
|
@ -10,7 +11,6 @@
|
||||||
[ext_resource type="Resource" uid="uid://3gxjbodh4fwe" path="res://riangle_enemy.tres" id="5_xdrk0"]
|
[ext_resource type="Resource" uid="uid://3gxjbodh4fwe" path="res://riangle_enemy.tres" id="5_xdrk0"]
|
||||||
[ext_resource type="Texture2D" uid="uid://yvrhlh04k8w1" path="res://background space.png" id="6_yg4g1"]
|
[ext_resource type="Texture2D" uid="uid://yvrhlh04k8w1" path="res://background space.png" id="6_yg4g1"]
|
||||||
[ext_resource type="Script" path="res://wave_enemy.gd" id="7_54h7d"]
|
[ext_resource type="Script" path="res://wave_enemy.gd" id="7_54h7d"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cgcjicue76wsr" path="res://player.tscn" id="7_ujibo"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://cwquv3mq5kk1d" path="res://countdown-spritesheet.png" id="8_e1eub"]
|
[ext_resource type="Texture2D" uid="uid://cwquv3mq5kk1d" path="res://countdown-spritesheet.png" id="8_e1eub"]
|
||||||
[ext_resource type="AudioStream" uid="uid://dn65uapn0wsok" path="res://impactMetal_002.ogg" id="11_acuni"]
|
[ext_resource type="AudioStream" uid="uid://dn65uapn0wsok" path="res://impactMetal_002.ogg" id="11_acuni"]
|
||||||
[ext_resource type="Script" path="res://CollisionCheck.gd" id="11_ryeyk"]
|
[ext_resource type="Script" path="res://CollisionCheck.gd" id="11_ryeyk"]
|
||||||
|
@ -34,8 +34,8 @@ script = ExtResource("4_um0x7")
|
||||||
enemies = Array[ExtResource("7_54h7d")]([ExtResource("3_xmk5u")])
|
enemies = Array[ExtResource("7_54h7d")]([ExtResource("3_xmk5u")])
|
||||||
quantities = Array[int]([7])
|
quantities = Array[int]([7])
|
||||||
spawning_duration = 25.0
|
spawning_duration = 25.0
|
||||||
wait = 5.0
|
wait = 3.0
|
||||||
wait_for_killed = false
|
wait_for_killed = true
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_o8cet"]
|
[sub_resource type="Resource" id="Resource_o8cet"]
|
||||||
script = ExtResource("4_um0x7")
|
script = ExtResource("4_um0x7")
|
||||||
|
@ -636,6 +636,7 @@ gradient = SubResource("Gradient_or5lt")
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
position = Vector2(-2, -1)
|
position = Vector2(-2, -1)
|
||||||
|
script = ExtResource("1_3dydx")
|
||||||
|
|
||||||
[node name="Spawner" type="Node2D" parent="." node_paths=PackedStringArray("wave_label")]
|
[node name="Spawner" type="Node2D" parent="." node_paths=PackedStringArray("wave_label")]
|
||||||
script = ExtResource("1_ifu8g")
|
script = ExtResource("1_ifu8g")
|
||||||
|
@ -705,10 +706,6 @@ position = Vector2(1920, 540)
|
||||||
rotation = -1.5708
|
rotation = -1.5708
|
||||||
shape = SubResource("WorldBoundaryShape2D_rmvst")
|
shape = SubResource("WorldBoundaryShape2D_rmvst")
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("7_ujibo")]
|
|
||||||
position = Vector2(63, 58)
|
|
||||||
scale = Vector2(0.5, 0.5)
|
|
||||||
|
|
||||||
[node name="UI" type="Control" parent="."]
|
[node name="UI" type="Control" parent="."]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
|
|
|
@ -160,6 +160,24 @@ popup/item_0/id = 0
|
||||||
popup/item_1/text = "Absolute"
|
popup/item_1/text = "Absolute"
|
||||||
popup/item_1/id = 1
|
popup/item_1/id = 1
|
||||||
|
|
||||||
|
[node name="Label3" type="Label" parent="Settings Panel/Menu"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
theme_override_fonts/font = ExtResource("4_ybv7t")
|
||||||
|
theme_override_font_sizes/font_size = 80
|
||||||
|
text = "CLASS"
|
||||||
|
|
||||||
|
[node name="Character" type="OptionButton" parent="Settings Panel/Menu"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_fonts/font = ExtResource("4_ybv7t")
|
||||||
|
theme_override_font_sizes/font_size = 54
|
||||||
|
item_count = 2
|
||||||
|
selected = 0
|
||||||
|
popup/item_0/text = "Row"
|
||||||
|
popup/item_0/id = 0
|
||||||
|
popup/item_1/text = "Apezoid"
|
||||||
|
popup/item_1/id = 1
|
||||||
|
|
||||||
[node name="Tutorial Text" type="Label" parent="."]
|
[node name="Tutorial Text" type="Label" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
z_index = 2
|
z_index = 2
|
||||||
|
|
61
player-apezoid.gd
Normal file
61
player-apezoid.gd
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
extends "res://player.gd"
|
||||||
|
|
||||||
|
var can_damage = false
|
||||||
|
|
||||||
|
var idle_texture = preload("res://dotted line.png")
|
||||||
|
var aiming_texture = preload("res://laser_idle.png")
|
||||||
|
var active_texture = preload("res://ircle_laser.gif")
|
||||||
|
|
||||||
|
func update_animation():
|
||||||
|
if moving:
|
||||||
|
$Engine.play("active")
|
||||||
|
else:
|
||||||
|
$Engine.play("idle")
|
||||||
|
|
||||||
|
func _input(event):
|
||||||
|
if event.is_action_pressed("shoot"):
|
||||||
|
$Laser.fire()
|
||||||
|
fire_laser()
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
|
||||||
|
if can_damage:
|
||||||
|
var body = $Laser/RayCast2D.get_collider()
|
||||||
|
if body != null and body.is_in_group("destructible"):
|
||||||
|
if body.has_method("destroy"):
|
||||||
|
body.destroy()
|
||||||
|
else:
|
||||||
|
body.queue_free()
|
||||||
|
can_damage = false
|
||||||
|
|
||||||
|
func fire_laser():
|
||||||
|
var tween = get_tree().create_tween()
|
||||||
|
frozen = true
|
||||||
|
$Body.play("shoot")
|
||||||
|
tween.set_parallel(true)
|
||||||
|
tween.tween_callback(set_laser_texture.bind(aiming_texture))
|
||||||
|
tween.tween_property($Laser, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_IN)
|
||||||
|
tween.tween_callback(play_with_delay)
|
||||||
|
tween.set_parallel(false)
|
||||||
|
tween.tween_callback(can_shoot.bind(true))
|
||||||
|
tween.tween_callback(set_laser_texture.bind(active_texture))
|
||||||
|
tween.tween_callback($Laser.fire)
|
||||||
|
tween.tween_interval(0.2)
|
||||||
|
tween.tween_callback(can_shoot.bind(false))
|
||||||
|
tween.tween_callback(set_laser_texture.bind(aiming_texture))
|
||||||
|
tween.set_parallel(true)
|
||||||
|
tween.tween_property($Laser, "modulate", Color(Color.WHITE, 0.2), 0.2).set_ease(Tween.EASE_OUT)
|
||||||
|
tween.set_parallel(false)
|
||||||
|
tween.tween_callback(set_laser_texture.bind(idle_texture))
|
||||||
|
tween.tween_callback($Body.play.bind("idle"))
|
||||||
|
tween.tween_property(self, "frozen", false, 0)
|
||||||
|
|
||||||
|
func can_shoot(yn):
|
||||||
|
can_damage = yn
|
||||||
|
|
||||||
|
func play_with_delay():
|
||||||
|
await get_tree().create_timer(0.9).timeout
|
||||||
|
$LaserFX.play()
|
||||||
|
|
||||||
|
func set_laser_texture(texture):
|
||||||
|
$Laser.texture = texture
|
205
player-apezoid.tscn
Normal file
205
player-apezoid.tscn
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
[gd_scene load_steps=29 format=3 uid="uid://ctyntcrw0qf6w"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cgcjicue76wsr" path="res://player.tscn" id="1_4dgnt"]
|
||||||
|
[ext_resource type="Script" path="res://player-apezoid.gd" id="2_axxxt"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://jc63jnpm7inw" path="res://apezoid-gun.png" id="3_ijjv5"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://br5lt5658ioy3" path="res://apezoid_engine.png" id="3_paps8"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://1jurox63577w" path="res://apezoid-engine-idle.png" id="4_0rv3w"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="6_05kle"]
|
||||||
|
[ext_resource type="Script" path="res://Laser.gd" id="7_otdmu"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://4ou7posn1vbd" path="res://laserSmall_004.ogg" id="8_6whae"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_8qb1c"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(0, 0, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_i14ah"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(64, 0, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_0y7yb"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(128, 0, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_4tt11"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(0, 64, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_7enh4"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(64, 64, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_3u4ij"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(128, 64, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_wnc5h"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(0, 128, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_mt75u"]
|
||||||
|
atlas = ExtResource("3_paps8")
|
||||||
|
region = Rect2(64, 128, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_lx4pn"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_8qb1c")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_i14ah")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_0y7yb")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_4tt11")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_7enh4")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_3u4ij")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_wnc5h")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_mt75u")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"active",
|
||||||
|
"speed": 10.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4_0rv3w")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_2pyy3"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(0, 0, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_3ebjd"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(64, 0, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_4jusr"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(128, 0, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_18a2u"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(0, 64, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_c444v"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(64, 64, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_cd51w"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(128, 64, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_tq36p"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(0, 128, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_sk0h4"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(64, 128, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_5ik5x"]
|
||||||
|
atlas = ExtResource("3_ijjv5")
|
||||||
|
region = Rect2(128, 128, 64, 64)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_1rcaq"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_2pyy3")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_3ebjd")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_4jusr")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_18a2u")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_c444v")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_cd51w")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_tq36p")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_sk0h4")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_5ik5x")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"shoot",
|
||||||
|
"speed": 8.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_tkosh"]
|
||||||
|
radius = 14.0
|
||||||
|
height = 40.0
|
||||||
|
|
||||||
|
[node name="Player" instance=ExtResource("1_4dgnt")]
|
||||||
|
lock_rotation = true
|
||||||
|
script = ExtResource("2_axxxt")
|
||||||
|
|
||||||
|
[node name="Engine" type="AnimatedSprite2D" parent="." index="1"]
|
||||||
|
sprite_frames = SubResource("SpriteFrames_lx4pn")
|
||||||
|
animation = &"active"
|
||||||
|
autoplay = "idle"
|
||||||
|
|
||||||
|
[node name="Body" type="AnimatedSprite2D" parent="." index="2"]
|
||||||
|
sprite_frames = SubResource("SpriteFrames_1rcaq")
|
||||||
|
animation = &"shoot"
|
||||||
|
autoplay = "idle"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="3"]
|
||||||
|
position = Vector2(9, 1)
|
||||||
|
rotation = -1.5708
|
||||||
|
shape = SubResource("CapsuleShape2D_tkosh")
|
||||||
|
|
||||||
|
[node name="Laser" type="Line2D" parent="." index="4"]
|
||||||
|
self_modulate = Color(0, 1, 0.298039, 1)
|
||||||
|
z_index = -2
|
||||||
|
texture_filter = 1
|
||||||
|
texture_repeat = 2
|
||||||
|
position = Vector2(-3, 1)
|
||||||
|
points = PackedVector2Array(0, 0, 1075, 0)
|
||||||
|
width = 30.0
|
||||||
|
texture = ExtResource("6_05kle")
|
||||||
|
texture_mode = 1
|
||||||
|
script = ExtResource("7_otdmu")
|
||||||
|
|
||||||
|
[node name="VisibleTimer" type="Timer" parent="Laser" index="0"]
|
||||||
|
wait_time = 0.2
|
||||||
|
|
||||||
|
[node name="RayCast2D" type="RayCast2D" parent="Laser" index="1"]
|
||||||
|
target_position = Vector2(50000, 2.08165e-12)
|
||||||
|
collision_mask = 3
|
||||||
|
|
||||||
|
[node name="LaserFX" type="AudioStreamPlayer2D" parent="." index="5"]
|
||||||
|
stream = ExtResource("8_6whae")
|
||||||
|
|
||||||
|
[connection signal="timeout" from="Laser/VisibleTimer" to="Laser" method="hide_self"]
|
|
@ -1,5 +1,16 @@
|
||||||
extends "res://player.gd"
|
extends "res://player.gd"
|
||||||
|
|
||||||
|
const idle_anim = preload("res://player_idle.gif")
|
||||||
|
const moving_anim = preload("res://player_moving.gif")
|
||||||
|
|
||||||
|
func update_animation():
|
||||||
|
if moving:
|
||||||
|
$AnimatedSprite2D.sprite_frames = moving_anim
|
||||||
|
else:
|
||||||
|
$AnimatedSprite2D.sprite_frames = idle_anim
|
||||||
|
|
||||||
|
$AnimatedSprite2D.play("gif")
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
update_display()
|
update_display()
|
||||||
update_animation()
|
update_animation()
|
||||||
|
|
33
player-row.tscn
Normal file
33
player-row.tscn
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
[gd_scene load_steps=7 format=3 uid="uid://bfd8oqdyt6m3g"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cgcjicue76wsr" path="res://player.tscn" id="1_r3mct"]
|
||||||
|
[ext_resource type="SpriteFrames" uid="uid://cmkptgd3k37bl" path="res://player_idle.gif" id="2_sxnuc"]
|
||||||
|
[ext_resource type="Script" path="res://player-row.gd" id="2_ty4ic"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://cbghiy80qmaa0" path="res://powerUp6.ogg" id="3_sk1xt"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://mond5sdmukan" path="res://powerUp7.ogg" id="4_lwgj5"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_caugh"]
|
||||||
|
radius = 19.0263
|
||||||
|
|
||||||
|
[node name="Player" instance=ExtResource("1_r3mct")]
|
||||||
|
script = ExtResource("2_ty4ic")
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"]
|
||||||
|
texture_filter = 1
|
||||||
|
position = Vector2(-33, 0)
|
||||||
|
scale = Vector2(1.2, 1.2)
|
||||||
|
sprite_frames = ExtResource("2_sxnuc")
|
||||||
|
animation = &"gif"
|
||||||
|
frame = 5
|
||||||
|
frame_progress = 0.885413
|
||||||
|
speed_scale = 0.75
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="2"]
|
||||||
|
position = Vector2(3, 0)
|
||||||
|
shape = SubResource("CircleShape2D_caugh")
|
||||||
|
|
||||||
|
[node name="QuareFX" type="AudioStreamPlayer2D" parent="." index="3"]
|
||||||
|
stream = ExtResource("3_sk1xt")
|
||||||
|
|
||||||
|
[node name="ExagonFX" type="AudioStreamPlayer2D" parent="." index="4"]
|
||||||
|
stream = ExtResource("4_lwgj5")
|
32
player.tscn
32
player.tscn
|
@ -1,40 +1,14 @@
|
||||||
[gd_scene load_steps=7 format=3 uid="uid://cgcjicue76wsr"]
|
[gd_scene load_steps=3 format=3 uid="uid://cgcjicue76wsr"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://player-row.gd" id="1_4k5de"]
|
[ext_resource type="Script" path="res://player.gd" id="1_p12hv"]
|
||||||
[ext_resource type="SpriteFrames" uid="uid://cmkptgd3k37bl" path="res://player_idle.gif" id="2_c8tq3"]
|
|
||||||
[ext_resource type="AudioStream" uid="uid://cuu1qqskoqabg" path="res://Taco_Bell_Bong.ogg" id="3_urvwh"]
|
[ext_resource type="AudioStream" uid="uid://cuu1qqskoqabg" path="res://Taco_Bell_Bong.ogg" id="3_urvwh"]
|
||||||
[ext_resource type="AudioStream" uid="uid://cbghiy80qmaa0" path="res://powerUp6.ogg" id="4_i2tip"]
|
|
||||||
[ext_resource type="AudioStream" uid="uid://mond5sdmukan" path="res://powerUp7.ogg" id="5_bu8ku"]
|
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_nxtxc"]
|
|
||||||
radius = 19.0263
|
|
||||||
|
|
||||||
[node name="Player" type="RigidBody2D" groups=["destructible"]]
|
[node name="Player" type="RigidBody2D" groups=["destructible"]]
|
||||||
position = Vector2(-42, 74)
|
position = Vector2(-42, 74)
|
||||||
gravity_scale = 1.66533e-16
|
gravity_scale = 1.66533e-16
|
||||||
linear_damp = 1.0
|
linear_damp = 1.0
|
||||||
script = ExtResource("1_4k5de")
|
script = ExtResource("1_p12hv")
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
|
||||||
texture_filter = 1
|
|
||||||
position = Vector2(-33, 0)
|
|
||||||
scale = Vector2(1.2, 1.2)
|
|
||||||
sprite_frames = ExtResource("2_c8tq3")
|
|
||||||
animation = &"gif"
|
|
||||||
frame = 5
|
|
||||||
frame_progress = 0.885413
|
|
||||||
speed_scale = 0.75
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
position = Vector2(3, 0)
|
|
||||||
shape = SubResource("CircleShape2D_nxtxc")
|
|
||||||
|
|
||||||
[node name="DeathFX" type="AudioStreamPlayer2D" parent="."]
|
[node name="DeathFX" type="AudioStreamPlayer2D" parent="."]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
stream = ExtResource("3_urvwh")
|
stream = ExtResource("3_urvwh")
|
||||||
|
|
||||||
[node name="QuareFX" type="AudioStreamPlayer2D" parent="."]
|
|
||||||
stream = ExtResource("4_i2tip")
|
|
||||||
|
|
||||||
[node name="ExagonFX" type="AudioStreamPlayer2D" parent="."]
|
|
||||||
stream = ExtResource("5_bu8ku")
|
|
||||||
|
|
|
@ -76,6 +76,12 @@ quit={
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
shoot={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(91, 32),"global_position":Vector2(99, 112),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue