Fixed many Bugy and added Labels for Time and Score

This commit is contained in:
Exobyt 2024-08-20 00:34:24 +02:00
parent 632eeddc64
commit ee5e17c3e0
14 changed files with 430 additions and 179 deletions

View file

@ -3,6 +3,7 @@ extends Area2D
@onready var floorRaycast = $RaycastFloor
@onready var raycastLeft = $RaycastLeft
@onready var raycastRight = $RaycastRight
@onready var raycastTop = $RaycastTop
@export var UID = 1
@ -15,40 +16,6 @@ var type = GLOBAL.BLOCKTYPES.LIGHT
func _ready() -> void:
secretPosition = position
#func _physics_process(delta: float) -> void:
#print(secretPosition)
#print(getNeighbours())
#print(getNeighboursUID(UID))
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _physics_process(delta: float) -> void:
#if not getIsOnFloor():
# position = secretPosition.snapped(Vector2(64,64))
#if Input.is_action_just_pressed("left"):
# if not raycastLeft.is_colliding():
# secretPosition.x -= GLOBAL.GRID
#if Input.is_action_just_pressed("right"):
# if not raycastRight.is_colliding():
# secretPosition.x += GLOBAL.GRID
#secretPosition.y += GLOBAL.currentSpeed * delta * 30
func getIsOnFloor() -> bool:
return floorRaycast.is_colliding()
#func getFloorCollider():
#return floorRaycast.get_collider()
#
#func getLeftCollider():
#return raycastLeft.get_collider()
#
#func getRightCollider():
#return raycastRight.get_collider()
func getLeftColliding() -> bool:
return raycastLeft.is_colliding()
func getRightColliding() -> bool:
return raycastRight.is_colliding()
func getCollider(direction : GLOBAL.Direction):
match direction:
GLOBAL.Direction.BOTTOM:
@ -57,7 +24,8 @@ func getCollider(direction : GLOBAL.Direction):
return raycastLeft.get_collider()
GLOBAL.Direction.RIGHT:
return raycastRight.get_collider()
GLOBAL.Direction.TOP:
return raycastTop.get_collider()
func getNeighbours():
var neighbours = []