adjusted level and barrier

This commit is contained in:
pennyrigate 2022-12-19 21:08:18 -05:00
parent 209884f133
commit b2baccfa57
16 changed files with 138 additions and 46 deletions

View file

@ -14,6 +14,7 @@ enum State {IDLE,WALK,JUMP,FALL,STUNNED,CLIMB,SWORD,SHOOT}
var current_state = State.IDLE
##Runtime
var axis = Vector2.ZERO #Current direction being held
var trail_color = Color(0.25,0,1,0.4)
#Physics
var velocity = Vector2.ZERO
var walk_speed = 50
@ -66,9 +67,7 @@ func _physics_process(delta):
#Apply velocity
move_and_slide(velocity,Vector2.UP)
#Debug
if Input.is_action_pressed("debug_move_player"):
position = get_viewport().get_mouse_position()
print(get_viewport().get_mouse_position())
debug()
func _process_idle():
if anims.get_current_animation() != "idle": anims.play("idle")
@ -246,3 +245,8 @@ func _on_AnimationPlayer_animation_finished(anim_name):
else:
current_state = State.FALL
return
func debug():
#Move player to mouse
if Input.is_action_pressed("debug_move_player"):
position = get_viewport().get_mouse_position()
print(get_viewport().get_mouse_position())

View file

@ -15,7 +15,8 @@
[ext_resource path="res://scripts/recolor.tres" type="Shader" id=13]
[ext_resource path="res://graphics/player/sg_doublejump.png" type="Texture" id=14]
[sub_resource type="ShaderMaterial" id=27]
[sub_resource type="ShaderMaterial" id=38]
resource_local_to_scene = true
shader = ExtResource( 4 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = true
@ -598,8 +599,10 @@ extents = Vector2( 6, 7 )
[node name="Player" type="KinematicBody2D"]
script = ExtResource( 1 )
[node name="Trail" type="Node" parent="."]
[node name="Sprite" type="Sprite" parent="."]
material = SubResource( 27 )
material = SubResource( 38 )
texture = ExtResource( 3 )
region_enabled = true
region_rect = Rect2( 0, 0, 20, 20 )