31 lines
1,013 B
GDScript
31 lines
1,013 B
GDScript
extends Node2D
|
|
|
|
@export var camera : Camera2D
|
|
@export var map : Sprite2D
|
|
@export var cyclones : Array[RigidBody2D]
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
check_edges()
|
|
|
|
func check_edges():
|
|
#var right_center = map.global_position + Vector2(map.texture.get_width(), 0)
|
|
#var top_center = map.global_position + Vector2(0, map.texture.get_height())
|
|
var map_top : float = map.global_position.y + map.texture.get_height()
|
|
var map_bottom : float = map.global_position.y - map.texture.get_height()
|
|
var map_right : float = map.global_position.x + map.texture.get_width()
|
|
var map_left : float = map.global_position.x - map.texture.get_width()
|
|
print("Top: " + str(map_top))
|
|
print("Bottom: " + str(map_top))
|
|
print("Left: " + str(map_top))
|
|
print("Right: " + str(map_top))
|
|
|
|
for cyclone in cyclones:
|
|
pass
|
|
|
|
pass
|