this is the script
extends RigidBody2D
export var FLAP_FORCE = -200
const MAXROTATIONDEGREES = -30.0
onready var animator = $AnimationPlayer
var started = false
warning-ignore:unused_argument
func physicsprocess(delta):
if Input.isactionjust_pressed("flap"):
if !started:
start()
flap()
if rotation_degrees <= MAX_ROTATION_DEGREES:
angular_velocity = 0
rotation_degrees = MAX_ROTATION_DEGREES #the error is here
func start():
if started : return
started = true
gravity_scale = 5.0
animator.play("Flap")
func flap():
linearvelocity.y = FLAPFORCE
angular_velocity = -8