Skip to content

Commit

Permalink
Update Player.gd
Browse files Browse the repository at this point in the history
Behold, the player script now works in Godot 4 (for now)!
  • Loading branch information
KennethOshiro authored Aug 20, 2022
1 parent d04e059 commit 62220db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Player.gd
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extends KinematicBody2D
extends CharacterBody2D

const MOVE_SPEED = 300

onready var raycast = $RayCast2D
@onready var raycast = $RayCast2D

func _ready():
yield(get_tree(), "idle_frame")
await get_tree().physics_frame
get_tree().call_group("zombies", "set_player", self)

func _physics_process(delta):
Expand All @@ -30,4 +30,4 @@ func _physics_process(delta):
coll.kill()

func kill():
get_tree().reload_current_scene()
get_tree().reload_current_scene()

0 comments on commit 62220db

Please sign in to comment.