character switch

This commit is contained in:
Page Asgardius 2024-01-27 13:10:58 -07:00
parent d21d95ec86
commit 9391847aea
23 changed files with 692 additions and 112 deletions

View file

@ -6,11 +6,13 @@ 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, 20, true]], [[null, null, null, null ,false], ["res://levels/Testrooms/testspawn.tscn", 640, 360, 2 ,false]]]]
const places = [[[[null, null, false], [null, null, false]], [["res://levels/Testrooms/bullethell.tscn", 11, true], ["res://levels/Testrooms/lilytest.tscn", 20, true]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]]
var cplace = [0,2,1]
var dplace = [null, null, null]
const pchars = ["res://sprites/common/midori/midori.tscn"]
const npchars = []
const pchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
var party = [null, null, null, null]
var dparty = [0, 9, null, null]
var cpchar = 0
var dcpchar = 0
var mangohud = false
@ -23,7 +25,7 @@ var firstrun
const musictracks = ["res://music/reloaded.wav", "res://music/Jellies.wav", "res://music/getabrain.wav", "res://music/oskars.wav", "res://music/extralife.wav", "res://music/layers.wav", "res://music/caramel.wav", "res://music/XsEdzesSs.wav", "res://music/shakeshark.wav", "res://music/zubmarine.wav", "res://music/crammin.wav", "res://music/func.wav", "res://music/kaveh.wav", "res://music/rock.wav", "res://music/milkyway.wav", "res://music/sweetener.wav", "res://music/tooold.wav", "res://music/portello.wav", "res://music/songbirds.wav", "res://music/Gotanda.wav", "res://music/unreeeal.wav"]
const sfxtracks = ["res://sfx/braindamage.wav", "res://sfx/gaugefill.wav", "res://sfx/boomboombakudan.wav"]
var debug = false
const release = "R0.0.1-dev"
const release = "R0.0.2-dev"
var sk = false
var xm = 0
var ym = 0

View file

@ -0,0 +1,46 @@
[gd_scene load_steps=6 format=3 uid="uid://bspatjsjp628h"]
[ext_resource type="Script" path="res://levels/Testrooms/testspawn.gd" id="1_wsfn4"]
[ext_resource type="Texture2D" uid="uid://kxvipok4tnuw" path="res://backgounds/wip.jpg" id="2_5agyo"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_gs020"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nytv7"]
size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_wkumn"]
size = Vector2(1283, 20)
[node name="Testspawn" type="Node2D"]
script = ExtResource("1_wsfn4")
[node name="WIP" type="TextureRect" parent="."]
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("2_5agyo")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-11, 361.5)
shape = SubResource("RectangleShape2D_nytv7")
[node name="StaticBody2D2" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"]
position = Vector2(1293, 358)
shape = SubResource("RectangleShape2D_nytv7")
[node name="StaticBody2D3" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D3"]
position = Vector2(641.5, -9)
shape = SubResource("RectangleShape2D_wkumn")
[node name="StaticBody2D4" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_wkumn")
[node name="Player" parent="." instance=ExtResource("3_gs020")]
position = Vector2(654, 594)

View file

@ -0,0 +1,58 @@
[gd_scene load_steps=6 format=3 uid="uid://c8hmum2w6aygy"]
[ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_g5hs8"]
[ext_resource type="PackedScene" uid="uid://dpudp1d2wpryc" path="res://sprites/common/natasha/natasha.tscn" id="2_5cnwp"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_slxde"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1jr1w"]
size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iptg6"]
size = Vector2(1283, 20)
[node name="Bullethell" type="Node2D"]
[node name="TextureRect" type="TextureRect" parent="."]
offset_left = 583.0
offset_top = 4.0
offset_right = 711.0
offset_bottom = 260.0
texture = ExtResource("1_g5hs8")
[node name="Label" type="Label" parent="."]
offset_left = 327.0
offset_top = 354.0
offset_right = 957.0
offset_bottom = 409.0
theme_override_font_sizes/font_size = 40
text = "Boss spawns at EBU pattern area"
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-11, 361.5)
shape = SubResource("RectangleShape2D_1jr1w")
[node name="StaticBody2D2" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"]
position = Vector2(1293, 358)
shape = SubResource("RectangleShape2D_1jr1w")
[node name="StaticBody2D3" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D3"]
position = Vector2(641.5, -9)
shape = SubResource("RectangleShape2D_iptg6")
[node name="StaticBody2D4" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_iptg6")
[node name="Natasha" parent="." instance=ExtResource("2_5cnwp")]
position = Vector2(644, 133)
[node name="Player" parent="." instance=ExtResource("3_slxde")]
position = Vector2(652, 590)

View file

@ -0,0 +1,44 @@
[gd_scene load_steps=5 format=3 uid="uid://cs2dkktcbaptx"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="2_lfw71"]
[ext_resource type="Texture2D" uid="uid://kxvipok4tnuw" path="res://backgounds/wip.jpg" id="2_xoavp"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nytv7"]
size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_wkumn"]
size = Vector2(1283, 20)
[node name="Dialogtest" type="Node2D"]
[node name="WIP" type="TextureRect" parent="."]
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("2_xoavp")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-11, 361.5)
shape = SubResource("RectangleShape2D_nytv7")
[node name="StaticBody2D2" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"]
position = Vector2(1293, 358)
shape = SubResource("RectangleShape2D_nytv7")
[node name="StaticBody2D3" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D3"]
position = Vector2(641.5, -9)
shape = SubResource("RectangleShape2D_wkumn")
[node name="StaticBody2D4" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_wkumn")
[node name="Player" parent="." instance=ExtResource("2_lfw71")]
position = Vector2(597, 591)

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://cma7ddp0r4rm"]
[gd_scene load_steps=6 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"]
[ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_bch3a"]
[ext_resource type="PackedScene" uid="uid://b216q83uw4c45" path="res://sprites/common/midori/lily.tscn" id="2_v1fc7"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_h02gt"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1jr1w"]
size = Vector2(20, 761)
@ -9,14 +10,14 @@ size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iptg6"]
size = Vector2(1283, 20)
[node name="Testboss" type="Node2D"]
[node name="Lilytest" type="Node2D"]
[node name="TextureRect" type="TextureRect" parent="."]
offset_left = 583.0
offset_top = 4.0
offset_right = 711.0
offset_bottom = 260.0
texture = ExtResource("1_hxdyl")
texture = ExtResource("1_bch3a")
[node name="Label" type="Label" parent="."]
offset_left = 327.0
@ -50,5 +51,8 @@ shape = SubResource("RectangleShape2D_iptg6")
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_iptg6")
[node name="Lily" parent="." instance=ExtResource("2_ccp01")]
[node name="Lily" parent="." instance=ExtResource("2_v1fc7")]
position = Vector2(644, 133)
[node name="Player" parent="." instance=ExtResource("3_h02gt")]
position = Vector2(637, 595)

View file

@ -0,0 +1,11 @@
extends Node2D
# 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):
pass

View file

@ -1,6 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://b5cxd2rmstnpt"]
[gd_scene load_steps=6 format=3 uid="uid://b5cxd2rmstnpt"]
[ext_resource type="Script" path="res://levels/Testrooms/testspawn.gd" id="1_ps8y8"]
[ext_resource type="Texture2D" uid="uid://kxvipok4tnuw" path="res://backgounds/wip.jpg" id="1_yw0he"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_iqxlc"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nytv7"]
size = Vector2(20, 761)
@ -9,6 +11,7 @@ size = Vector2(20, 761)
size = Vector2(1283, 20)
[node name="Testspawn" type="Node2D"]
script = ExtResource("1_ps8y8")
[node name="WIP" type="TextureRect" parent="."]
offset_right = 40.0
@ -38,3 +41,6 @@ shape = SubResource("RectangleShape2D_wkumn")
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_wkumn")
[node name="Player" parent="." instance=ExtResource("3_iqxlc")]
position = Vector2(633, 590)

View file

@ -13,26 +13,26 @@ func _ready():
add_child(sfx1)
if Global.debug:
level = load(Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][0]).instantiate()
player = load(Global.pchars[Global.dcpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][3]]
isboss = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][4]
#player = load(Global.pchars[Global.dcpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]]
isboss = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
else:
level = load(Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][0]).instantiate()
player = load(Global.pchars[Global.cpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][3]]
isboss = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][4]
if Global.cspawnarea[0] != null && Global.cspawnarea[0] != null:
player.position.x = Global.cspawnarea[0]
player.position.y = Global.cspawnarea[1]
elif Global.debug:
player.position.x = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]
player.position.y = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
else:
player.position.x = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]
player.position.y = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
# player = load(Global.pchars[Global.cpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]]
isboss = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
#if Global.cspawnarea[0] != null && Global.cspawnarea[0] != null:
# player.position.x = Global.cspawnarea[0]
# player.position.y = Global.cspawnarea[1]
#elif Global.debug:
# player.position.x = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]
# player.position.y = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
#else:
# player.position.x = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]
# player.position.y = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
music = load(musictrack)
get_tree().root.add_child.call_deferred(level)
get_tree().root.add_child.call_deferred(player)
#get_tree().root.add_child.call_deferred(player)
bgsound.stream = music
if isboss:
sfx1.stream = load(Global.sfxtracks[1])
@ -46,7 +46,7 @@ func _process(delta):
Global.xm = 0
Global.ym = 0
var velocity = Vector2.ZERO
if Global.live == 1:
if Global.live == 1 && !Input.is_key_pressed(KEY_V) && !Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER):
if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2:
Global.xm = Input.get_joy_axis(0,JOY_AXIS_LEFT_X)
Global.ym = Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
@ -59,7 +59,7 @@ func _process(delta):
Global.ym = -1
if Input.is_action_pressed("ui_down"):
Global.ym = 1
velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
#velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
func _input(event):
if Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK):
@ -70,3 +70,31 @@ func _input(event):
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
else:
get_tree().change_scene_to_file("res://title.tscn")
if (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP)):
if Global.debug:
if Global.dparty[0] != null:
Global.dcpchar = 0
else:
if Global.party[0] != null:
Global.cpchar = 0
elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT)):
if Global.debug:
if Global.dparty[1] != null:
Global.dcpchar = 1
else:
if Global.party[1] != null:
Global.cpchar = 1
elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN)):
if Global.debug:
if Global.dparty[2] != null:
Global.dcpchar = 2
else:
if Global.party[2] != null:
Global.cpchar = 2
elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT)):
if Global.debug:
if Global.dparty[3] != null:
Global.dcpchar = 3
else:
if Global.party[3] != null:
Global.cpchar = 3

View file

@ -52,7 +52,19 @@ func _on_testspawn_pressed():
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")
func _on_testboss_pressed():
func _on_lilytest_pressed():
Global.dplace = [0, 1, 1]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")
func _on_dialogtest_pressed():
Global.dplace = [0, 2, 0]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")
func _on_bullethell_pressed():
Global.dplace = [0, 1, 0]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")

View file

@ -57,13 +57,26 @@ theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Test Spawn"
[node name="Testboss" type="Button" parent="VBoxContainer"]
[node name="Lilytest" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Test Boss
text = "Test Boss (Lily)
"
[node name="Dialogtest" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Dialog Test
"
[node name="Bullethell" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Bullet hell test (Natasha)"
[node name="Credits" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
@ -87,5 +100,7 @@ layout_mode = 1
[connection signal="finished" from="nebula" to="nebula" method="_on_finished"]
[connection signal="pressed" from="VBoxContainer/Testspawn" to="." method="_on_testspawn_pressed"]
[connection signal="pressed" from="VBoxContainer/Testboss" to="." method="_on_testboss_pressed"]
[connection signal="pressed" from="VBoxContainer/Lilytest" to="." method="_on_lilytest_pressed"]
[connection signal="pressed" from="VBoxContainer/Dialogtest" to="." method="_on_dialogtest_pressed"]
[connection signal="pressed" from="VBoxContainer/Bullethell" to="." method="_on_bullethell_pressed"]
[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"]

View file

@ -11,38 +11,41 @@ var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
@onready var anim := $AnimationPlayer
func _physics_process(delta):
velocity.x = 0
velocity.y = 0
# Add the gravity.
#var velocity = Vector2.ZERO
if Global.live == 1:
#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")
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:
if angle == 0:
anim.play("nidle")
elif angle == 1:
anim.play("eidle")
elif angle == 3:
anim.play("widle")
else:
anim.play("sidle")
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()

View file

@ -1,48 +0,0 @@
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 Global.ym > 0.3:
angle = 2
elif Global.ym < -0.3:
angle = 0
elif Global.xm > 0.3:
angle = 1
elif Global.xm < -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()

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5boweesf7vb1"
path="res://.godot/imported/face.png-74b09380d4eb743c6025e87a71c0e191.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/natasha/face.png"
dest_files=["res://.godot/imported/face.png-74b09380d4eb743c6025e87a71c0e191.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cf5i7ff2yyant"
path="res://.godot/imported/fullbody.png-6952c6a295446e9ef348eacff999af75.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/natasha/fullbody.png"
dest_files=["res://.godot/imported/fullbody.png-6952c6a295446e9ef348eacff999af75.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

View file

@ -0,0 +1,51 @@
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):
velocity.x = 0
velocity.y = 0
# 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
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()

View file

@ -0,0 +1,180 @@
[gd_scene load_steps=14 format=3 uid="uid://dpudp1d2wpryc"]
[ext_resource type="Script" path="res://sprites/common/natasha/natasha.gd" id="1_kycyt"]
[ext_resource type="Texture2D" uid="uid://7pw16o08gyuk" path="res://sprites/common/natasha/sprite.png" id="2_grplw"]
[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="Natasha" type="CharacterBody2D"]
script = ExtResource("1_kycyt")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_grplw")
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")
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://7pw16o08gyuk"
path="res://.godot/imported/sprite.png-ecdb256869b0f955b86b845c103c3e46.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/natasha/sprite.png"
dest_files=["res://.godot/imported/sprite.png-ecdb256869b0f955b86b845c103c3e46.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

Binary file not shown.

View file

@ -0,0 +1,68 @@
extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -400.0
var angle = 2
var sprite
var anim
var csprite
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
func _ready():
anim = $AnimationPlayer
sprite = $Sprite2D
if Global.debug:
csprite = Global.dcpchar
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
else:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
csprite
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
if Global.debug:
if Global.dcpchar != csprite:
csprite = Global.dcpchar
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
else:
if Global.cpchar != csprite:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
#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 Global.ym > 0.3:
angle = 2
elif Global.ym < -0.3:
angle = 0
elif Global.xm > 0.3:
angle = 1
elif Global.xm < -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()

View file

@ -1,7 +1,6 @@
[gd_scene load_steps=14 format=3 uid="uid://cehe6sm8ly06u"]
[gd_scene load_steps=13 format=3 uid="uid://cehe6sm8ly06u"]
[ext_resource type="Script" path="res://sprites/common/midori/midori.gd" id="1_6vvcv"]
[ext_resource type="Texture2D" uid="uid://bc2vrf8qggvtp" path="res://sprites/common/midori/sprite.png" id="1_oqq2w"]
[ext_resource type="Script" path="res://sprites/common/player/player.gd" id="1_6vvcv"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dj8gt"]
size = Vector2(86, 68)
@ -162,11 +161,10 @@ _data = {
"wwalk": SubResource("Animation_letwb")
}
[node name="Midori" type="CharacterBody2D"]
[node name="Player" type="CharacterBody2D"]
script = ExtResource("1_6vvcv")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_oqq2w")
hframes = 3
vframes = 4