Compare commits
5 commits
35e193d74f
...
05c8dbca70
| Author | SHA1 | Date | |
|---|---|---|---|
| 05c8dbca70 | |||
| f352190612 | |||
| 76694fda2f | |||
| d4b571428b | |||
| 7c700fb288 |
3 changed files with 9 additions and 10 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
[ext_resource type="Texture2D" uid="uid://wdjmyv260he1" path="res://world/textures/grass.jpg" id="2_272bh"]
|
[ext_resource type="Texture2D" uid="uid://wdjmyv260he1" path="res://world/textures/grass.jpg" id="2_272bh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://of6tq8gpjxtu" path="res://gears/gear_pickup.tscn" id="3_lquwl"]
|
[ext_resource type="PackedScene" uid="uid://of6tq8gpjxtu" path="res://gears/gear_pickup.tscn" id="3_lquwl"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bafl8q0r61xrg" path="res://gears/gear.tscn" id="4_7mycd"]
|
[ext_resource type="PackedScene" uid="uid://bafl8q0r61xrg" path="res://gears/gear.tscn" id="4_7mycd"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bkq72dydktldv" path="res://world/sky/sky.hdr" id="8_5vw27"]
|
[ext_resource type="Texture2D" uid="uid://bkq72dydktldv" path="res://world/textures/sky.hdr" id="8_5vw27"]
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_7dm0k"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_7dm0k"]
|
||||||
size = Vector3(1000, 2, 1000)
|
size = Vector3(1000, 2, 1000)
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ func _input(event):
|
||||||
if event is InputEventMouseMotion:
|
if event is InputEventMouseMotion:
|
||||||
mouse_x_velocity = event.relative.x
|
mouse_x_velocity = event.relative.x
|
||||||
mouse_y_velocity = event.relative.y
|
mouse_y_velocity = event.relative.y
|
||||||
elif event.is_action_pressed("zoom_in"):
|
|
||||||
current_zoom += 5
|
|
||||||
elif event.is_action_pressed("zoom_out"):
|
elif event.is_action_pressed("zoom_out"):
|
||||||
|
current_zoom += 5
|
||||||
|
elif event.is_action_pressed("zoom_in"):
|
||||||
current_zoom -= 5
|
current_zoom -= 5
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
|
@ -41,17 +41,16 @@ func _process(delta):
|
||||||
shift_lock = false
|
shift_lock = false
|
||||||
else:
|
else:
|
||||||
shift_lock = true
|
shift_lock = true
|
||||||
|
|
||||||
elif Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT) or shift_lock == true:
|
elif Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT) or shift_lock == true:
|
||||||
if mouse_locked == false:
|
if mouse_locked == false:
|
||||||
mouse_locked = true
|
mouse_locked = true
|
||||||
locked_mouse_positon = get_viewport().get_mouse_position()
|
locked_mouse_positon = get_viewport().get_mouse_position()
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||||
if mouse_x_velocity > 5 or mouse_x_velocity < -5:
|
|
||||||
y -= clamp(mouse_x_velocity / 12.5,-10,10)
|
|
||||||
if mouse_y_velocity > 5 or mouse_y_velocity < -5:
|
|
||||||
x -= clamp(mouse_y_velocity / 12.5,-10,10)
|
|
||||||
|
|
||||||
|
if mouse_x_velocity > 5 or mouse_x_velocity < -5:
|
||||||
|
y -= clamp(mouse_x_velocity / 12.5, -10, 10)
|
||||||
|
if mouse_y_velocity > 5 or mouse_y_velocity < -5:
|
||||||
|
x -= clamp(mouse_y_velocity / 12.5, -10, 10)
|
||||||
else:
|
else:
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
mouse_locked = false
|
mouse_locked = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue