Guest User

Untitled

a guest
Jun 19th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. var combo_frames = 60
  2. var hitbox_show_frame = 24
  3. var pause_threshold = 45
  4. var hitbox_show_dur_in_frames = 6
  5. var hitbox_consumed = false
  6. var current_frame = 0
  7. var hitbox_show_curr_frame = 0
  8.  
  9. func _physics_process(delta): #Godot2D's fixedUpdate()
  10. current_frame += 1
  11. if current_frame >= hitbox_show_frame and not hitbox_consumed:
  12. hitbox_coll.disabled = false
  13. if current_frame >= hitbox_show_frame + hitbox_show_dur_in_frames:
  14. hitbox_coll.disabled = false
  15. hitbox_consumed = true
  16. if frame_num >= combo_frames:
  17. combo_index = 0
  18. return Melee_Idle.new()
  19. pass
  20.  
  21. func _input(event):
  22. if hitbox_consumed:
  23. if current_frame < pause_threshold:
  24. return Melee_Combo2.new() #normal combo
  25. elif current_frame < combo_frames:
  26. return Melee_Combo2_Alt.new() #alternate combo after some delay
Add Comment
Please, Sign In to add comment