Add files via upload

This commit is contained in:
brausjonas
2023-10-07 00:50:42 +02:00
committed by GitHub
parent 286615fa44
commit 18da5a38a0
99 changed files with 2014 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
extends CharacterBody2D
class_name Bird
var gravity = 800
var jump_force = 200
var max_speed = 350
@onready var animation_player = $AnimationPlayer
func _ready():
velocity = Vector2(0, 0)
animation_player.play("flap_wings")
func _physics_process(delta):
if Input.is_mouse_button_pressed(1) or Input.is_action_just_pressed("jump"):
velocity.y = -jump_force
velocity.y += gravity * delta
velocity.y = min(velocity.y, max_speed)
move_and_collide(velocity * delta)