From 209884f133b08280700a7da744745cd61182233e Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Mon, 19 Dec 2022 17:37:36 -0500 Subject: [PATCH] cleaned up player script --- objects/player/player.gd | 15 ++++++++------- project.godot | 4 ++++ sg_outline.png | Bin 292 -> 0 bytes sg_outline.png.import | 35 ----------------------------------- test_outline.png | Bin 446 -> 0 bytes test_outline.png.import | 35 ----------------------------------- testwalk.gd | 16 ---------------- 7 files changed, 12 insertions(+), 93 deletions(-) delete mode 100644 sg_outline.png delete mode 100644 sg_outline.png.import delete mode 100644 test_outline.png delete mode 100644 test_outline.png.import delete mode 100644 testwalk.gd diff --git a/objects/player/player.gd b/objects/player/player.gd index 39959eb..55cb246 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -42,12 +42,16 @@ func _physics_process(delta): continue State.IDLE, State.WALK: _process_idle_walk() + continue State.JUMP: _process_jump() continue State.FALL: _process_fall() continue + State.JUMP, State.FALL: + _process_jump_fall() + continue State.CLIMB: _process_climb() continue @@ -103,25 +107,22 @@ func _process_idle_walk(): func _process_jump(): jump_pressure += 1 - move(walk_speed,0,true) - check_double_jump() #Pressure sensitive jump if jump_pressure == 15 or Input.is_action_just_released("jump"): velocity.y = -jump_force / 4 #velocity.y = 0 current_state = State.FALL - #Goto Shoot - check_shoot() func _process_fall(): if anims.get_current_animation() != "doublejump": anims.play("jump") - check_double_jump() - #anims.play("jump") - move(walk_speed,0,true) #Return to idle if is_on_floor(): current_state = State.IDLE return + +func _process_jump_fall(): + check_double_jump() + move(walk_speed,0,true) #Goto Shoot check_shoot() diff --git a/project.godot b/project.godot index d3a87ce..3e58672 100644 --- a/project.godot +++ b/project.godot @@ -23,6 +23,10 @@ Game="*res://game.tscn" window/size/width=256 window/size/height=192 +[editor_plugins] + +enabled=PoolStringArray( ) + [gui] common/drop_mouse_on_gui_input_disabled=true diff --git a/sg_outline.png b/sg_outline.png deleted file mode 100644 index f94026c394f3823914aa49f24b97dd31b80ab191..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQajKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijS1AIbUf%N|>i~l=k{|ADr^O`GX#Y7ZXm^qf(h+3$C%vSnU{RBvHmjw9* zgVaC(gO@+!C!jEAfk$L90|Vb-5N14{zaj-FSnBEG7@`rJdLfeUfC2|gz?z2BfBEk? zs+Yd3ai|RR(W-Szv)JI-6%d(tK1hkTN}*UOPV(tt!}N<9+=c#|SKjJ#R=({w>qt}U zB$b)gubfs$T=;hV;u$Xmbu$^Ar*5I;*X19*=-s#_=6~^?FUO;@v(3*PNq?{JvXFCy U=a%V5fev8sboFyt=akR{0B*Z(djJ3c diff --git a/sg_outline.png.import b/sg_outline.png.import deleted file mode 100644 index 7fd45a3..0000000 --- a/sg_outline.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/sg_outline.png-d83bd4211370f1ca4f13854b52bba784.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://sg_outline.png" -dest_files=[ "res://.import/sg_outline.png-d83bd4211370f1ca4f13854b52bba784.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 diff --git a/test_outline.png b/test_outline.png deleted file mode 100644 index f1f0ac0e935e7bc1b1d497f32d931ebf8d8f3eba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 446 zcmeAS@N?(olHy`uVBq!ia0vp^0YEIm!3-pI*}R?tDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheiUB?$u0Z;KmBs&^v;PCZ)p^a8vtl9&EX*8BZA2|pKxQlbs(u2bxJ!ck zfQ9=5%FjOzayz--oK9A5b6Ta(*Rs*+ zeN02+gjch 0.0: - flip_h = false - - if dir == 0: - play("idle") - else: - play("move")