lily test
This commit is contained in:
parent
05d2c2e424
commit
04a65188c9
8 changed files with 315 additions and 34 deletions
|
@ -6,7 +6,7 @@ var origmpos
|
|||
var mousepos
|
||||
var timelimit = 15000
|
||||
var wait
|
||||
const places = [[[[null, null, null, null, false], [null, null, null, null, false]], [[null, null, null, null, false], ["res://levels/Testrooms/testboss.tscn", 640, 360, 11, true]], [[null, null, null, null ,false], ["res://levels/Testrooms/testspawn.tscn", 640, 360, 2 ,false]]]]
|
||||
const places = [[[[null, null, null, null, false], [null, null, null, null, false]], [[null, null, null, null, false], ["res://levels/Testrooms/testboss.tscn", 640, 360, 20, true]], [[null, null, null, null ,false], ["res://levels/Testrooms/testspawn.tscn", 640, 360, 2 ,false]]]]
|
||||
var cplace = [0,2,1]
|
||||
var dplace = [null, null, null]
|
||||
const pchars = ["res://sprites/common/midori/midori.tscn"]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cma7ddp0r4rm"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cma7ddp0r4rm"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_hxdyl"]
|
||||
[ext_resource type="PackedScene" uid="uid://b216q83uw4c45" path="res://sprites/common/midori/lily.tscn" id="2_ccp01"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1jr1w"]
|
||||
size = Vector2(20, 761)
|
||||
|
@ -48,3 +49,6 @@ shape = SubResource("RectangleShape2D_iptg6")
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
|
||||
position = Vector2(644, 731)
|
||||
shape = SubResource("RectangleShape2D_iptg6")
|
||||
|
||||
[node name="Lily" parent="." instance=ExtResource("2_ccp01")]
|
||||
position = Vector2(644, 133)
|
||||
|
|
BIN
sprites/common/bullet/fireball.png
Normal file
BIN
sprites/common/bullet/fireball.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
34
sprites/common/bullet/fireball.png.import
Normal file
34
sprites/common/bullet/fireball.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cfqxhmvjstwcd"
|
||||
path="res://.godot/imported/fireball.png-48161d71ad4463f879f805acccd13beb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/common/bullet/fireball.png"
|
||||
dest_files=["res://.godot/imported/fireball.png-48161d71ad4463f879f805acccd13beb.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
|
15
sprites/common/bullet/fireball.tscn
Normal file
15
sprites/common/bullet/fireball.tscn
Normal file
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://b2gxwerkgrbp7"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cfqxhmvjstwcd" path="res://sprites/common/bullet/fireball.png" id="1_ues2l"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tqfch"]
|
||||
size = Vector2(47, 60)
|
||||
|
||||
[node name="Fireball" type="RigidBody2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_ues2l")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0.5, 0)
|
||||
shape = SubResource("RectangleShape2D_tqfch")
|
48
sprites/common/midori/lily.gd
Normal file
48
sprites/common/midori/lily.gd
Normal file
|
@ -0,0 +1,48 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
|
||||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -400.0
|
||||
var angle = 2
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
||||
@onready var anim := $AnimationPlayer
|
||||
|
||||
func _physics_process(delta):
|
||||
# Add the gravity.
|
||||
#var velocity = Vector2.ZERO
|
||||
if Global.live == 1:
|
||||
#velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta
|
||||
#origmpos = get_viewport().get_mouse_position()
|
||||
#if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0:
|
||||
# velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
|
||||
#position += velocity
|
||||
if velocity.y > 0.3:
|
||||
angle = 2
|
||||
elif velocity.y < -0.3:
|
||||
angle = 0
|
||||
elif velocity.x > 0.3:
|
||||
angle = 1
|
||||
elif velocity.x < -0.3:
|
||||
angle = 3
|
||||
if velocity.y != 0 || velocity.x != 0:
|
||||
if angle == 0:
|
||||
anim.play("nwalk")
|
||||
elif angle == 1:
|
||||
anim.play("ewalk")
|
||||
elif angle == 3:
|
||||
anim.play("wwalk")
|
||||
else:
|
||||
anim.play("swalk")
|
||||
else:
|
||||
if angle == 0:
|
||||
anim.play("nidle")
|
||||
elif angle == 1:
|
||||
anim.play("eidle")
|
||||
elif angle == 3:
|
||||
anim.play("widle")
|
||||
else:
|
||||
anim.play("sidle")
|
||||
move_and_slide()
|
180
sprites/common/midori/lily.tscn
Normal file
180
sprites/common/midori/lily.tscn
Normal file
|
@ -0,0 +1,180 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://b216q83uw4c45"]
|
||||
|
||||
[ext_resource type="Script" path="res://sprites/common/midori/lily.gd" id="1_0lf8i"]
|
||||
[ext_resource type="Texture2D" uid="uid://bc2vrf8qggvtp" path="res://sprites/common/midori/sprite.png" id="2_lcff3"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dj8gt"]
|
||||
size = Vector2(86, 68)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_i5rhc"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8my4d"]
|
||||
resource_name = "eidle"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [6]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_op07l"]
|
||||
resource_name = "ewalk"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [7, 6, 8]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_cajcr"]
|
||||
resource_name = "nidle"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.2),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [3]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7lhgw"]
|
||||
resource_name = "nwalk"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [4, 3, 5]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_w3ius"]
|
||||
resource_name = "sidle"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_u56r5"]
|
||||
resource_name = "swalk"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [1, 0, 2]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_isodq"]
|
||||
resource_name = "widle"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.2),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [9]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_letwb"]
|
||||
resource_name = "wwalk"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [10, 9, 11]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mh65y"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_i5rhc"),
|
||||
"eidle": SubResource("Animation_8my4d"),
|
||||
"ewalk": SubResource("Animation_op07l"),
|
||||
"nidle": SubResource("Animation_cajcr"),
|
||||
"nwalk": SubResource("Animation_7lhgw"),
|
||||
"sidle": SubResource("Animation_w3ius"),
|
||||
"swalk": SubResource("Animation_u56r5"),
|
||||
"widle": SubResource("Animation_isodq"),
|
||||
"wwalk": SubResource("Animation_letwb")
|
||||
}
|
||||
|
||||
[node name="Lily" type="CharacterBody2D"]
|
||||
script = ExtResource("1_0lf8i")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_lcff3")
|
||||
hframes = 3
|
||||
vframes = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 94)
|
||||
shape = SubResource("RectangleShape2D_dj8gt")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_mh65y")
|
||||
}
|
|
@ -21,6 +21,38 @@ tracks/0/keys = {
|
|||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8my4d"]
|
||||
resource_name = "eidle"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [6]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_op07l"]
|
||||
resource_name = "ewalk"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [7, 6, 8]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_cajcr"]
|
||||
resource_name = "nidle"
|
||||
tracks/0/type = "value"
|
||||
|
@ -85,38 +117,6 @@ tracks/0/keys = {
|
|||
"values": [1, 0, 2]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8my4d"]
|
||||
resource_name = "eidle"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [6]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_op07l"]
|
||||
resource_name = "ewalk"
|
||||
length = 0.3
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [7, 6, 8]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_isodq"]
|
||||
resource_name = "widle"
|
||||
tracks/0/type = "value"
|
||||
|
|
Loading…
Reference in a new issue