a bit of restructuring, renaming, and c sharp setup
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
extends Camera2D
|
||||
|
||||
@export var multiplier = 1.0
|
||||
@export var followNode: Node2D
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
transform.origin.x = followNode.transform.origin.x
|
||||
transform.origin.y = followNode.transform.origin.y
|
||||
@@ -0,0 +1 @@
|
||||
uid://51hbiq1mdpv1
|
||||
@@ -0,0 +1,22 @@
|
||||
extends Node3D
|
||||
|
||||
@export var canPitch: bool = false
|
||||
@export var canYaw: bool = false
|
||||
@export var rotateSpeed: float = 0.003
|
||||
@onready var sub_pivot: Node3D = $SubPivot
|
||||
|
||||
func _ready() -> void:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("click"):
|
||||
if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
|
||||
if event is InputEventMouseMotion:
|
||||
if Input.mouse_mode != Input.MOUSE_MODE_CAPTURED: return
|
||||
if canYaw: sub_pivot.rotate_x(event.relative.y * -rotateSpeed)
|
||||
if canPitch: rotate_y(event.relative.x * -rotateSpeed)
|
||||
@@ -0,0 +1 @@
|
||||
uid://c4fc60lv6436s
|
||||
@@ -0,0 +1,5 @@
|
||||
extends Node
|
||||
class_name DialogicStarter
|
||||
|
||||
func open(timeline: String):
|
||||
Dialogic.start(timeline)
|
||||
@@ -0,0 +1 @@
|
||||
uid://d2486x6upmwqq
|
||||
@@ -0,0 +1,16 @@
|
||||
extends Node3D
|
||||
|
||||
@onready var area_3d: Area3D = $Area3D
|
||||
@onready var label_3d: Label3D = $Label3D
|
||||
|
||||
signal interacted
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if area_3d.has_overlapping_bodies():
|
||||
label_3d.show()
|
||||
else:
|
||||
label_3d.hide()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action("interact") && event.is_pressed() && area_3d.has_overlapping_bodies():
|
||||
interacted.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://bfwe1vlfyknm7
|
||||
@@ -0,0 +1,30 @@
|
||||
extends Node2D
|
||||
|
||||
@export var speed: float = 100.0
|
||||
|
||||
# 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:
|
||||
if Input.is_action_pressed("move_right"):
|
||||
position.x += speed * delta
|
||||
if Input.is_action_pressed("move_left"):
|
||||
position.x -= speed * delta
|
||||
if Input.is_action_pressed("move_up"):
|
||||
position.y -= speed * delta
|
||||
if Input.is_action_pressed("move_down"):
|
||||
position.y += speed * delta
|
||||
|
||||
|
||||
|
||||
if Input.is_action_just_pressed("ui_up"):
|
||||
Dialogic.start("test_time_line")
|
||||
if Input.is_action_just_pressed("ui_down"):
|
||||
if TranslationServer.get_locale() == "en":
|
||||
TranslationServer.set_locale("de")
|
||||
else:
|
||||
TranslationServer.set_locale("en")
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://c3itdui8uq68b
|
||||
@@ -0,0 +1,30 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
|
||||
@export var SPEED = 1.0
|
||||
|
||||
@onready var camera_3d: Camera3D = $CameraPivot/SubPivot/Camera3D
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity += Vector3.DOWN * delta
|
||||
|
||||
# Handle jump.
|
||||
#if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||
# velocity.y = JUMP_VELOCITY
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
var input_dir := Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
input_dir = input_dir.rotated(-camera_3d.global_rotation.y)
|
||||
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
||||
if direction:
|
||||
velocity.x = direction.x * SPEED
|
||||
velocity.z = direction.z * SPEED
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||
velocity.z = move_toward(velocity.z, 0, SPEED)
|
||||
|
||||
move_and_slide()
|
||||
@@ -0,0 +1 @@
|
||||
uid://dke381v8tafqn
|
||||
Reference in New Issue
Block a user