Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kb173 committed Aug 28, 2019
2 parents a43ad42 + 442385f commit 9ac7fa3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Global/GlobalSignal.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ signal missing_map
signal missing_3rd
signal missing_1st

# Perspective handling
signal main_perspective_active(is_active)

# signal the ui to show the miniview again
signal miniview_show

Expand Down
1 change: 1 addition & 0 deletions Global/PlayerInfo.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var last_player_pos = Vector3(0, 0, 0)
var last_player_look_direction = Vector3(0, 0, 0)

var is_follow_enabled: bool = true
var is_main_active: bool = false

var walk_speed: float = 10

Expand Down
13 changes: 12 additions & 1 deletion Perspectives/AbstractPlayer/AbstractPlayer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ var mouse_sensitivity = Settings.get_setting("player", "mouse-sensitivity")

func _ready():
Offset.connect("shift_world", self, "shift")

if is_main_perspective:
PlayerInfo.is_main_active = true


# This is a function that can handle notification, we will use it for "destructor"-purposes
func _notification(what):
if what == NOTIFICATION_PREDELETE:
if is_main_perspective:
PlayerInfo.is_main_active = false


func _physics_process(delta):
Expand Down Expand Up @@ -88,7 +98,8 @@ func _handle_general_input(event):

# Shift the player's in-engine translation by a certain offset, but not the player's true coordinates.
func shift(delta_x, delta_z):
PlayerInfo.add_player_pos(Vector3(delta_x, 0, delta_z))
if is_main_perspective or not PlayerInfo.is_main_active:
PlayerInfo.add_player_pos(Vector3(delta_x, 0, delta_z))

translation.x += delta_x
translation.z += delta_z
6 changes: 3 additions & 3 deletions default-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

"level-0-tile-size": 9783.93962,
"level-0-osm-zoom": 12,
"default-tile-subdivision": 32,
"default-tile-subdivision": 16,
"update-interval-seconds": 0.2,
"world-shift-distance": 1000,
"tile-spawn-radius": 1,
"tile-spawn-radius": 3,
"tile-removal-check-radius-summand": 2,
"distances": [
5000,
Expand Down Expand Up @@ -47,7 +47,7 @@
},

"item-spawner": {
"camera-ray-length": 2000
"camera-ray-length": 5000
},

"herbage": {
Expand Down

0 comments on commit 9ac7fa3

Please sign in to comment.