add skelarcher

This commit is contained in:
pennyrigate 2023-01-20 04:46:24 -05:00
parent a2974d8dd3
commit 9827e2d9b4
8 changed files with 252 additions and 3 deletions

View file

@ -2,7 +2,7 @@
[ext_resource path="res://scripts/scaling.gd" type="Script" id=1] [ext_resource path="res://scripts/scaling.gd" type="Script" id=1]
[ext_resource path="res://graphics/borders/prideborder.png" type="Texture" id=2] [ext_resource path="res://graphics/borders/prideborder.png" type="Texture" id=2]
[ext_resource path="res://maps/cave.tscn" type="PackedScene" id=3] [ext_resource path="res://maps/canopy.tscn" type="PackedScene" id=3]
[ext_resource path="res://scripts/crt.gdshader" type="Shader" id=4] [ext_resource path="res://scripts/crt.gdshader" type="Shader" id=4]
[ext_resource path="res://scripts/theme.tres" type="Theme" id=5] [ext_resource path="res://scripts/theme.tres" type="Theme" id=5]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/skelarcher_duck.png-ea842fa5209405d34f5606825e37ff96.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/enemy/skelarcher_duck.png"
dest_files=[ "res://.import/skelarcher_duck.png-ea842fa5209405d34f5606825e37ff96.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 266 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 462 B

Before After
Before After

View file

@ -1,9 +1,11 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=1] [ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=1]
[ext_resource path="res://maps/map.gd" type="Script" id=2] [ext_resource path="res://maps/map.gd" type="Script" id=2]
[ext_resource path="res://graphics/backgrounds/canopy.png" type="Texture" id=3] [ext_resource path="res://graphics/backgrounds/canopy.png" type="Texture" id=3]
[ext_resource path="res://tilesets/t_canopy.tres" type="TileSet" id=4] [ext_resource path="res://tilesets/t_canopy.tres" type="TileSet" id=4]
[ext_resource path="res://objects/enemy/skelarcher.tscn" type="PackedScene" id=5]
[ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=6]
[node name="Map" type="Node2D" groups=["map"]] [node name="Map" type="Node2D" groups=["map"]]
script = ExtResource( 2 ) script = ExtResource( 2 )
@ -15,8 +17,14 @@ position = Vector2( 128, 96 )
z_index = -2 z_index = -2
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="Ground" type="TileMap" parent="Camera2D"] [node name="Ground" type="TileMap" parent="."]
tile_set = ExtResource( 4 ) tile_set = ExtResource( 4 )
cell_size = Vector2( 8, 8 ) cell_size = Vector2( 8, 8 )
format = 1 format = 1
tile_data = PoolIntArray( 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1507328, 0, 65537, 1507329, 0, 65537, 1507330, 0, 65537, 1507331, 0, 65537, 1507332, 0, 65537, 1507333, 0, 65537, 1507334, 0, 65537, 1507335, 0, 65537, 1507336, 0, 65537, 1507337, 0, 65537, 1507338, 0, 65537, 1507339, 0, 65537, 1507340, 0, 65537, 1507341, 0, 65537, 1507342, 0, 65537, 1507343, 0, 65537, 1507344, 0, 65537, 1507345, 0, 65537, 1507346, 0, 65537, 1507347, 0, 65537, 1507348, 0, 65537, 1507349, 0, 65537, 1507350, 0, 65537, 1507351, 0, 65537, 1507352, 0, 65537, 1507353, 0, 65537, 1507354, 0, 65537, 1507355, 0, 65537, 1507356, 0, 65537, 1507357, 0, 65537, 1507358, 0, 65537, 1507359, 0, 65537 ) tile_data = PoolIntArray( 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1507328, 0, 65537, 1507329, 0, 65537, 1507330, 0, 65537, 1507331, 0, 65537, 1507332, 0, 65537, 1507333, 0, 65537, 1507334, 0, 65537, 1507335, 0, 65537, 1507336, 0, 65537, 1507337, 0, 65537, 1507338, 0, 65537, 1507339, 0, 65537, 1507340, 0, 65537, 1507341, 0, 65537, 1507342, 0, 65537, 1507343, 0, 65537, 1507344, 0, 65537, 1507345, 0, 65537, 1507346, 0, 65537, 1507347, 0, 65537, 1507348, 0, 65537, 1507349, 0, 65537, 1507350, 0, 65537, 1507351, 0, 65537, 1507352, 0, 65537, 1507353, 0, 65537, 1507354, 0, 65537, 1507355, 0, 65537, 1507356, 0, 65537, 1507357, 0, 65537, 1507358, 0, 65537, 1507359, 0, 65537 )
[node name="Player" parent="." instance=ExtResource( 6 )]
position = Vector2( 24, 166 )
[node name="Skelarcher" parent="." instance=ExtResource( 5 )]
position = Vector2( 70, 166 )

View file

@ -0,0 +1,32 @@
extends "res://objects/enemy/enemy.gd"
export var shoot_time = 1.0
export var arrow_speed = 120.0
onready var timer = $Timer
onready var anims = $AnimationPlayer
onready var sprite = $Sprite
const ArrowProjectile = preload("res://objects/player/arrow_projectile.tscn")
const arrowpos = Vector2(4,4)
func _ready():
timer.start(shoot_time)
func _process(delta):
Debug.print(Game.get_map())
func _on_Timer_timeout():
anims.play("shoot")
func spawn_arrow():
var arrow = ArrowProjectile.instance()
arrow.global_position = Vector2(
global_position.x + arrowpos.x * sprite.scale.x,
global_position.y + arrowpos.y
)
arrow.direction = sprite.scale.x
arrow.target_group = "player"
arrow.speed = arrow_speed
Game.get_map().add_child(arrow)
timer.start(shoot_time)

View file

@ -0,0 +1,174 @@
[gd_scene load_steps=18 format=2]
[ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=1]
[ext_resource path="res://graphics/enemy/skelarcher_shoot.png" type="Texture" id=2]
[ext_resource path="res://graphics/enemy/skelarcher_idle.png" type="Texture" id=3]
[ext_resource path="res://objects/enemy/skelarcher.gd" type="Script" id=4]
[sub_resource type="ShaderMaterial" id=18]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = true
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = true
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 19, 20 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 2 )
region = Rect2( 19, 0, 19, 20 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 2 )
region = Rect2( 38, 0, 19, 20 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 2 )
region = Rect2( 57, 0, 19, 20 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 2 )
region = Rect2( 76, 0, 19, 20 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 2 )
region = Rect2( 95, 0, 19, 20 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 2 )
region = Rect2( 114, 0, 19, 20 )
[sub_resource type="SpriteFrames" id=9]
animations = [ {
"frames": [ ExtResource( 3 ) ],
"loop": true,
"name": "idle",
"speed": 5.0
}, {
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ],
"loop": false,
"name": "shoot",
"speed": 15.0
} ]
[sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 4, 4 )
[sub_resource type="Animation" id=19]
resource_name = "idle"
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:region_rect")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Rect2( 0, 0, 19, 20 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:texture")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ ExtResource( 2 ) ]
}
[sub_resource type="Animation" id=20]
resource_name = "shoot"
length = 0.5
step = 0.06
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:region_rect")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.06, 0.12, 0.24, 0.3, 0.36, 0.42 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ Rect2( 0, 0, 19, 20 ), Rect2( 19, 0, 19, 20 ), Rect2( 38, 0, 19, 20 ), Rect2( 76, 0, 19, 20 ), Rect2( 95, 0, 19, 20 ), Rect2( 114, 0, 19, 20 ), Rect2( 133, 0, 19, 20 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:texture")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ ExtResource( 2 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("AnimationPlayer:current_animation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0.48 ),
"transitions": PoolRealArray( 1 ),
"update": 2,
"values": [ "idle" ]
}
tracks/3/type = "method"
tracks/3/path = NodePath(".")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0.24 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "spawn_arrow"
} ]
}
[node name="Skelarcher" type="Node2D" groups=["enemy"]]
script = ExtResource( 4 )
shoot_time = 3.0
[node name="Sprite" type="Sprite" parent="."]
material = SubResource( 18 )
texture = ExtResource( 2 )
region_enabled = true
region_rect = Rect2( 0, 0, 19, 20 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
visible = false
material = SubResource( 1 )
frames = SubResource( 9 )
animation = "idle"
playing = true
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2( -1, 6 )
shape = SubResource( 10 )
[node name="Timer" type="Timer" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/idle = SubResource( 19 )
anims/shoot = SubResource( 20 )
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]