diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/game.gd | 4 | ||||
-rw-r--r-- | client/player/controllable_player.gd | 22 | ||||
-rw-r--r-- | client/settings.gd | 1 |
3 files changed, 19 insertions, 8 deletions
diff --git a/client/game.gd b/client/game.gd index 8b2b00c3..f041cca9 100644 --- a/client/game.gd +++ b/client/game.gd @@ -185,8 +185,8 @@ func handle_packet(p): var player: Player = players[p.player] var item_name: String = item_names[p.message.item] player.item_message(item_name, timeout_initial, timeout_remaining) - if player.is_customer and Global.get_profile("tutorials_played") < 3: - mp.send_chat(player_id, "/start-tutorial %s" % item_name) + #if player.is_customer and Global.get_profile("tutorials_played") < 3: + #mp.send_chat(player_id, "/start-tutorial %s" % item_name) elif "text" in p.message: players[p.player].text_message(p.message.text, timeout_initial, timeout_remaining) var username: String = players[p.player].username diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index 142d5f47..9e7ce2b2 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -58,10 +58,11 @@ func _process(delta): super(delta) update_touch_scrolls() +var moving_duration = 0 func _process_movement(delta): var input = Input.get_vector("left", "right", "forwards", "backwards") if is_input_enabled() else Vector2.ZERO var boost = Input.is_action_pressed("boost") or (Global.get_setting("gameplay.latch_boost") and boosting) - input = input.rotated( - game.camera.angle_target) + input = input.rotated(-game.camera.angle_target) if Input.is_action_pressed("interact") or Input.is_action_just_released("interact"): input *= 0 else: @@ -69,6 +70,13 @@ func _process_movement(delta): int(floor(movement_base.position.x + sin(movement_base.rotation.y))), int(floor(movement_base.position.z + cos(movement_base.rotation.y))) ) + + if Global.get_setting("gameplay.accessible_movement"): + if input.length() < 0.5: moving_duration -= delta * 2 + else: moving_duration += delta + moving_duration = clamp(moving_duration, 0, 1) + input *= min(1, moving_duration) + interact() var was_boosting = boosting direction = input @@ -81,8 +89,10 @@ func _process_movement(delta): func update(dt: float, boost: bool): direction = direction.limit_length(1.); - if direction.length() > 0.1: - self.facing = direction + (self.facing - direction) * exp( - dt * 10.) + if direction.length() > 0.05: + self.facing = direction + (self.facing - direction) * exp(-dt * 10.) + if direction.length() < 0.5: + direction *= 0 rotation_ = atan2(self.facing.x, self.facing.y); boost = boost and direction.length() > 0.1 boosting = boost and (boosting or stamina >= 1.0) and stamina > 0 @@ -92,12 +102,12 @@ func update(dt: float, boost: bool): var speed = PLAYER_SPEED * (BOOST_FACTOR if boosting else 1.) self.velocity_ += direction * dt * speed self.position_ += self.velocity_ * dt - self.velocity_ = self.velocity_ * exp( - dt * PLAYER_FRICTION) + self.velocity_ = self.velocity_ * exp(-dt * PLAYER_FRICTION) collide(dt) func collide(dt: float): - for xo in range( - 1, 2): - for yo in range( - 1, 2): + for xo in range(-1, 2): + for yo in range(-1, 2): var tile = Vector2i(xo, yo) + Vector2i(self.position_) if !game.get_tile_collision(tile): continue tile = Vector2(tile) diff --git a/client/settings.gd b/client/settings.gd index 9152c0e4..9318322b 100644 --- a/client/settings.gd +++ b/client/settings.gd @@ -27,6 +27,7 @@ static func get_root(): ToggleSetting.new("setup_completed", false), ToggleSetting.new("tutorial_started", false), ToggleSetting.new("latch_boost", true), + ToggleSetting.new("accessible_movement", false), ]), SettingsCategory.new("graphics", [ PresetRow.new("preset", { |