Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var combo_frames = 60
- var hitbox_show_frame = 24
- var pause_threshold = 45
- var hitbox_show_dur_in_frames = 6
- var hitbox_consumed = false
- var current_frame = 0
- var hitbox_show_curr_frame = 0
- func _physics_process(delta): #Godot2D's fixedUpdate()
- current_frame += 1
- if current_frame >= hitbox_show_frame and not hitbox_consumed:
- hitbox_coll.disabled = false
- if current_frame >= hitbox_show_frame + hitbox_show_dur_in_frames:
- hitbox_coll.disabled = false
- hitbox_consumed = true
- if frame_num >= combo_frames:
- combo_index = 0
- return Melee_Idle.new()
- pass
- func _input(event):
- if hitbox_consumed:
- if current_frame < pause_threshold:
- return Melee_Combo2.new() #normal combo
- elif current_frame < combo_frames:
- return Melee_Combo2_Alt.new() #alternate combo after some delay
Add Comment
Please, Sign In to add comment