Prof AJ

GS Escola de Tecnologia 🧡

Plataforma de conteúdos e atividades tecnológicas do Prof AJ (Alziro Júnior) .

extends Node3D

@export var sensibilidade: float = 0.003

func _ready() -> void:
# Trava o mouse no centro da tela ao iniciar o jogo
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
# Gira o Pivot na horizontal (olhar para os lados)
rotate_y(-event.relative.x * sensibilidade)
# Gira a câmera na vertical (olhar para cima/baixo)
$Camera3D.rotate_x(-event.relative.y * sensibilidade)
# Limita o ângulo vertical para a câmera não dar cambalhota
$Camera3D.rotation.x = clamp($Camera3D.rotation.x, deg_to_rad(-60), deg_to_rad(45))

# Aperte ESC para soltar o mouse durante os testes
if event.is_action_pressed("ui_cancel"):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)













extends CharacterBody3D

@export var velocidade: float = 6.0
@export var forca_pulo: float = 5.5

var gravidade: float = ProjectSettings.get_setting("physics/3d/default_gravity")

@onready var pivot: Node3D = $Pivot
@onready var malha: MeshInstance3D = $MeshInstance3D

func _physics_process(delta: float) -> void:
# 1. Gravidade
if not is_on_floor():
velocity.y -= gravidade * delta

# 2. Pulo com a barra de espaço
if Input.is_key_pressed(KEY_SPACE) and is_on_floor():
velocity.y = forca_pulo

# 3. Direcao do teclado (WASD)
var eixo_x := 0.0
var eixo_z := 0.0

if Input.is_key_pressed(KEY_A):
eixo_x -= 1.0
if Input.is_key_pressed(KEY_D):
eixo_x += 1.0
if Input.is_key_pressed(KEY_W):
eixo_z -= 1.0
if Input.is_key_pressed(KEY_S):
eixo_z += 1.0

var input_dir := Vector2(eixo_x, eixo_z).normalized()

# 4. Movimento relativo ao Pivot da camera
var direcao := (pivot.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()

if direcao:
velocity.x = direcao.x * velocidade
velocity.z = direcao.z * velocidade

var angulo_alvo := atan2(-direcao.x, -direcao.z)
malha.rotation.y = lerp_angle(malha.rotation.y, angulo_alvo, 10.0 * delta)
else:
velocity.x = move_toward(velocity.x, 0, velocidade)
velocity.z = move_toward(velocity.z, 0, velocidade)

move_and_slide()

Coordenação Motora Total

COORDENAÇÃO MOTORA TOTAL 🎯

⏳ 1200s ⚡ 0 TPM

Teste Botões Mouse

GS MOUSE MASTER 🖱️

AGUARDANDO...
⏳ 45s | 🎯 0

Quiz GS - Gerais

QUIZ ESCOLAR DE CONHECIMENTOS GERAIS

Desafio Escolar (8 a 18 anos)

Quiz GS - Informática

QUIZ DE INFORMÁTICA & TECNOLOGIA

Testes de Conhecimento (Banco Expandido - 100 Questões)