Erster Prototyp
This commit is contained in:
parent
2da5af8954
commit
885351b624
48 changed files with 1350 additions and 0 deletions
33
scenes/Block/block_part.gd
Normal file
33
scenes/Block/block_part.gd
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
extends Area2D
|
||||
|
||||
var points = 1
|
||||
|
||||
@onready var rayCastTOP = $Raycasts/RayCastTOP
|
||||
@onready var rayCastRIGHT = $Raycasts/RayCastRIGHT
|
||||
@onready var rayCastBOTTOM = $Raycasts/RayCastBOTTOM
|
||||
@onready var rayCastLEFT = $Raycasts/RayCastLEFT
|
||||
|
||||
|
||||
func getCollisionTOP() -> bool:
|
||||
if rayCastTOP.get_collider() != null:
|
||||
if rayCastTOP.get_collider().get_parent() != get_parent():
|
||||
return rayCastTOP.is_colliding()
|
||||
return false
|
||||
|
||||
func getCollisionRIGHT() -> bool:
|
||||
if rayCastRIGHT.get_collider() != null:
|
||||
if rayCastRIGHT.get_collider().get_parent() != get_parent():
|
||||
return rayCastRIGHT.is_colliding()
|
||||
return false
|
||||
|
||||
func getCollisionBOTTOM() -> bool:
|
||||
if rayCastBOTTOM.get_collider() != null:
|
||||
if rayCastBOTTOM.get_collider().get_parent() != get_parent():
|
||||
return rayCastBOTTOM.is_colliding()
|
||||
return false
|
||||
|
||||
func getCollisionLEFT() -> bool:
|
||||
if rayCastLEFT.get_collider() != null:
|
||||
if rayCastLEFT.get_collider().get_parent() != get_parent():
|
||||
return rayCastLEFT.is_colliding()
|
||||
return false
|
||||
Loading…
Add table
Add a link
Reference in a new issue