Browse Source

Swapping left and right click interact

pull/12/head
Ryan Reed 1 month ago
parent
commit
40ded7db02
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      README.md
  2. +1
    -1
      scenes/blocks/block.gd
  3. +2
    -2
      scenes/player/ray_cast_look.gd

+ 2
- 2
README.md View File

@ -11,8 +11,8 @@ This was initially based on Sable Spirit Studio's YT series but has evolved to b
| Description | Binding | | Description | Binding |
| ----------- | ------- | | ----------- | ------- |
| Create block | `Right Click` |
| Delete/Remove block | `Left Click` |
| Create block | `Left Click` |
| Delete/Remove block | `Right Click` |
| Change selected block (next) | `.` | | Change selected block (next) | `.` |
| Change selected block (previous) | `,` | | Change selected block (previous) | `,` |
| Change selected block | `Scroll Wheel` | | Change selected block | `Scroll Wheel` |


+ 1
- 1
scenes/blocks/block.gd View File

@ -28,7 +28,7 @@ func hook() -> void:
# TODO: Rename to something else (maybe remove()) # TODO: Rename to something else (maybe remove())
# Move to signal? # Move to signal?
func interact_left_click() -> void:
func destroy_block() -> void:
queue_free() queue_free()
func release() -> void: func release() -> void:


+ 2
- 2
scenes/player/ray_cast_look.gd View File

@ -6,9 +6,9 @@ func _process(_delta: float) -> void:
var collider: Object = get_collider() var collider: Object = get_collider()
if collider is Block: if collider is Block:
if Input.is_action_just_pressed("left_click_interact"):
(collider as Block).interact_left_click()
if Input.is_action_just_pressed("right_click_interact"): if Input.is_action_just_pressed("right_click_interact"):
(collider as Block).destroy_block()
if Input.is_action_just_pressed("left_click_interact"):
EntityManager.create_block.emit( EntityManager.create_block.emit(
InventoryManager.quick_slot_item_id, InventoryManager.quick_slot_item_id,
collider.position + get_collision_normal() collider.position + get_collision_normal()


Loading…
Cancel
Save