This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Area2D | |
var direction : Vector2 = Vector2.ZERO | |
var speed: int = 350 | |
var can_move : bool = true | |
var min_positions: Vector2 = Vector2(20, 176) | |
var max_positions: Vector2 = Vector2(520, 730) | |
func _process(delta: float) -> void: | |
if can_move: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Control | |
var pressed_position: Vector2 | |
var release_position: Vector2 | |
func _input(event: InputEvent) -> void: | |
if Input.is_action_just_pressed("click"): | |
pressed_position = event.position | |
if Input.is_action_just_released("click"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Control | |
var pressed_position: Vector2 | |
var release_position: Vector2 | |
func _input(event: InputEvent) -> void: | |
if Input.is_action_just_pressed("click"): | |
pressed_position = event.position | |
if Input.is_action_just_released("click"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
540 | |
960 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Camera3D | |
@onready var ray_cast_3d: RayCast3D = $RayCast3D | |
@export var grid_map: GridMap | |
@export var turret_manager: Node3D | |
@export var turret_cost := 100 | |
@onready var bank := get_tree().get_first_node_in_group("Bank") | |
# Called every frame. 'delta' is the elapsed time since the previous frame. | |
func _process(delta: float) -> void: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.InputSystem; | |
public class BallHandler : MonoBehaviour | |
{ | |
private Camera mainCamera; | |
// Start is called once before the first execution of Update after the MonoBehaviour is created | |
void Start() | |
{ | |
mainCamera = Camera.main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node3D | |
@export var projectile: PackedScene | |
@onready var turret_top: MeshInstance3D = $TurretBase/TurretTop | |
var enemy_path: Path3D | |
func _physics_process(delta: float) -> void: | |
var enemy = enemy_path.get_children().back() | |
look_at(enemy.global_position, Vector3.UP, true) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Area3D | |
var direction := Vector3.FORWARD | |
@export var speed := 30.0 | |
func _physics_process(delta: float) -> void: | |
position += direction * speed * delta | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node3D | |
@export var projectile: PackedScene | |
func _ready() -> void: | |
var shot = projectile.instantiate() | |
add_child(shot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node3D | |
@export var turret: PackedScene | |
# Called when the node enters the scene tree for the first time. | |
func _ready() -> void: | |
var new_turret = turret.instantiate() | |
add_child(new_turret) |
NewerOlder