mirror of
https://github.com/Relintai/broken_seals_2d.git
synced 2024-11-11 20:35:10 +01:00
Remove dmore unneeded sripts and scenes.
This commit is contained in:
parent
5631fd22d7
commit
ec9ceddf9d
@ -1,133 +0,0 @@
|
||||
extends Sprite
|
||||
|
||||
enum Facing {
|
||||
FACING_RIGHT = 0,
|
||||
FACING_LEFT = 1,
|
||||
FACING_FRONT = 2,
|
||||
FACING_BACK = 3
|
||||
}
|
||||
|
||||
enum Animations {
|
||||
ANIMATION_RUN = 0,
|
||||
ANIMATION_WALK = 1,
|
||||
ANIMATION_CAST = 2,
|
||||
ANIMATION_STAND = 3
|
||||
}
|
||||
|
||||
export(bool) var enabled : bool = true
|
||||
|
||||
export(float) var timer : float = 0.13
|
||||
|
||||
export(int) var _animset = 0
|
||||
export(int) var _animset_size = 16
|
||||
export(int) var _animset_count = 16
|
||||
|
||||
var _min_frame = 0
|
||||
var _max_frame = 16 * 16
|
||||
|
||||
var x = 0
|
||||
var y = 0
|
||||
var _timer : float = 0
|
||||
var _frame : int = 0
|
||||
|
||||
var _facing : int = Facing.FACING_RIGHT
|
||||
var _current_animation : int = Animations.ANIMATION_STAND
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
#set_frame(_min_frame)
|
||||
update_animset()
|
||||
#_sprite.set_position(Vector2(x, y))
|
||||
|
||||
func set_movement_vector(vector):
|
||||
var a = Vector2(vector.x, vector.z)
|
||||
a = a.normalized()
|
||||
|
||||
var base = Vector2(0, -1)
|
||||
|
||||
var angle = a.angle_to(base) + PI
|
||||
|
||||
var slice = (2*PI) / _animset_count
|
||||
|
||||
var num_slice = int(angle / slice)
|
||||
|
||||
set_animset(num_slice)
|
||||
|
||||
|
||||
|
||||
func set_animset(animest_id):
|
||||
if (animest_id >= _animset_count):
|
||||
_animset = _animset_count - 1
|
||||
|
||||
if (animest_id < 0):
|
||||
_animset = 0
|
||||
|
||||
_animset = animest_id
|
||||
|
||||
|
||||
#_min_frame = _animset * _animset_size
|
||||
#_max_frame = _animset * _animset_size + _animset_size
|
||||
|
||||
func update_animset():
|
||||
_animset = _current_animation * 4 + (_facing)
|
||||
|
||||
func _process(delta):
|
||||
#set_animset(_animset)
|
||||
|
||||
if not enabled:
|
||||
set_process(false)
|
||||
return
|
||||
|
||||
_timer += delta
|
||||
|
||||
if (_timer > timer):
|
||||
_timer -= timer
|
||||
_frame += 1
|
||||
|
||||
if _frame > _animset_size - 1:
|
||||
_frame = 0
|
||||
|
||||
set_frame(_frame + (_animset * _animset_size))
|
||||
|
||||
func set_to_move():
|
||||
if _current_animation != Animations.ANIMATION_RUN:
|
||||
_current_animation = Animations.ANIMATION_RUN
|
||||
_frame = 0
|
||||
|
||||
func set_facing(input_direction : Vector2) -> void:
|
||||
var front : bool = abs(input_direction.dot(Vector2(0, 1))) > 0.9
|
||||
|
||||
if front:
|
||||
if input_direction.y > 0:
|
||||
_facing = Facing.FACING_FRONT
|
||||
else:
|
||||
_facing = Facing.FACING_BACK
|
||||
else:
|
||||
if input_direction.x > 0.01:
|
||||
_facing = Facing.FACING_RIGHT
|
||||
elif input_direction.x < -0.01:
|
||||
_facing = Facing.FACING_LEFT
|
||||
|
||||
update_animset()
|
||||
|
||||
func set_to_stand():
|
||||
if _current_animation != Animations.ANIMATION_STAND:
|
||||
_current_animation = Animations.ANIMATION_STAND
|
||||
_frame = 0
|
||||
update_animset()
|
||||
|
||||
func set_to_cast():
|
||||
if _current_animation != Animations.ANIMATION_CAST:
|
||||
_current_animation = Animations.ANIMATION_CAST
|
||||
_frame = 0
|
||||
update_animset()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func a_process(delta):
|
||||
#x += int(delta * 300)
|
||||
y += int(delta * 200)
|
||||
|
||||
if y > 700:
|
||||
y = -50
|
||||
|
||||
set_position(Vector2(x, y))
|
@ -1,52 +0,0 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://characters/naturalist_characteratlas.tres" type="CharacterAtlas" id=1]
|
||||
[ext_resource path="res://player/CharacterSkeleton2DGD.gd" type="Script" id=2]
|
||||
[ext_resource path="res://characters/CharacterSideModel.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://characters/CharacterFrontModel.tscn" type="PackedScene" id=6]
|
||||
|
||||
[node name="Character" type="CharacterSkeleton2D"]
|
||||
entity_type = 1
|
||||
attach_point_paths/0_left_hand = NodePath("")
|
||||
attach_point_paths/1_right_hand = NodePath("")
|
||||
attach_point_paths/2_torso = NodePath("")
|
||||
attach_point_paths/3_root = NodePath("")
|
||||
attach_point_paths/4_right_hip = NodePath("")
|
||||
attach_point_paths/5_left_hip = NodePath("")
|
||||
attach_point_paths/6_spine_2 = NodePath("")
|
||||
attach_point_paths/7_weapon_left = NodePath("")
|
||||
attach_point_paths/8_weapon_right = NodePath("")
|
||||
attach_point_paths/9_weapon_left_back = NodePath("")
|
||||
attach_point_paths/10_weapon_right_back = NodePath("")
|
||||
attach_point_paths/11_weapon_shield_left = NodePath("")
|
||||
script = ExtResource( 2 )
|
||||
front_node_path = NodePath("CharacterFrontModel")
|
||||
front_animation_player_path = NodePath("../Character/CharacterFrontModel/AnimationPlayer")
|
||||
front_animation_tree_path = NodePath("../Character/CharacterFrontModel/AnimationTree")
|
||||
side_node_path = NodePath("CharacterSideModel")
|
||||
side_animation_player_path = NodePath("../Character/CharacterSideModel/AnimationPlayer")
|
||||
side_animation_tree_path = NodePath("../Character/CharacterSideModel/AnimationTree")
|
||||
character_atlas = ExtResource( 1 )
|
||||
|
||||
[node name="CharacterFrontModel" parent="." instance=ExtResource( 6 )]
|
||||
visible = false
|
||||
|
||||
[node name="Torso" parent="CharacterFrontModel/Hip" index="1"]
|
||||
position = Vector2( 0, -2.33066 )
|
||||
|
||||
[node name="leg_r" parent="CharacterFrontModel/Hip/Torso" index="0"]
|
||||
position = Vector2( -2, 1 )
|
||||
|
||||
[node name="CharacterSideModel" parent="." instance=ExtResource( 5 )]
|
||||
|
||||
[node name="arm_r" parent="CharacterSideModel" index="0"]
|
||||
position = Vector2( -3.49998, -24.142 )
|
||||
|
||||
[node name="hand_r" parent="CharacterSideModel" index="1"]
|
||||
position = Vector2( -3.49998, -18.642 )
|
||||
|
||||
[node name="Torso" parent="CharacterSideModel/Hip" index="3"]
|
||||
position = Vector2( 5.75098e-05, -1.52647 )
|
||||
|
||||
[editable path="CharacterFrontModel"]
|
||||
[editable path="CharacterSideModel"]
|
@ -1,27 +0,0 @@
|
||||
extends CharacterSkeleton2D
|
||||
|
||||
export(NodePath) var sprite_path : NodePath
|
||||
|
||||
var _sprite : Sprite
|
||||
var _standing = true
|
||||
|
||||
func _ready():
|
||||
_sprite = get_node(sprite_path)
|
||||
|
||||
func get_sprite() -> Sprite:
|
||||
return _sprite
|
||||
|
||||
func move_dir(input_dir):
|
||||
if _standing:
|
||||
_standing = false
|
||||
_sprite.set_to_move()
|
||||
|
||||
_sprite.set_facing(input_dir)
|
||||
|
||||
func stand():
|
||||
if _standing:
|
||||
return
|
||||
|
||||
_standing = true
|
||||
|
||||
_sprite.set_to_stand()
|
@ -1,37 +0,0 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://testsave.png" type="Texture" id=1]
|
||||
[ext_resource path="res://characters/CharacterSprite.gd" type="Script" id=2]
|
||||
[ext_resource path="res://characters/SheetCharacter.gd" type="Script" id=3]
|
||||
[ext_resource path="res://lights/light32x16.png" type="Texture" id=4]
|
||||
|
||||
[node name="SheetCharacter" type="CharacterSkeleton2D"]
|
||||
entity_type = 1
|
||||
attach_point_paths/0_left_hand = NodePath("")
|
||||
attach_point_paths/1_right_hand = NodePath("")
|
||||
attach_point_paths/2_torso = NodePath("")
|
||||
attach_point_paths/3_root = NodePath("")
|
||||
attach_point_paths/4_right_hip = NodePath("")
|
||||
attach_point_paths/5_left_hip = NodePath("")
|
||||
attach_point_paths/6_spine_2 = NodePath("")
|
||||
attach_point_paths/7_weapon_left = NodePath("")
|
||||
attach_point_paths/8_weapon_right = NodePath("")
|
||||
attach_point_paths/9_weapon_left_back = NodePath("")
|
||||
attach_point_paths/10_weapon_right_back = NodePath("")
|
||||
attach_point_paths/11_weapon_shield_left = NodePath("")
|
||||
script = ExtResource( 3 )
|
||||
sprite_path = NodePath("CharacterSprite")
|
||||
|
||||
[node name="CharacterSprite" type="Sprite" parent="."]
|
||||
modulate = Color( 0.737255, 0.737255, 0.784314, 1 )
|
||||
position = Vector2( 0, -11.906 )
|
||||
z_index = 1
|
||||
texture = ExtResource( 1 )
|
||||
hframes = 16
|
||||
vframes = 16
|
||||
script = ExtResource( 2 )
|
||||
timer = 0.07
|
||||
|
||||
[node name="Light2D" type="Light2D" parent="."]
|
||||
texture = ExtResource( 4 )
|
||||
texture_scale = 12.0
|
Loading…
Reference in New Issue
Block a user