la souris fait bouger qu'au clic gauche

This commit is contained in:
Thomas
2025-03-30 08:12:11 +02:00
parent 5b83435748
commit ce77fc810f
4 changed files with 16 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ else:
Bob: Est-ce que tu connais les contrôles du jeu?
Bob: En vrai, si tu est venu jusqu'à moi et qu'on parle, je suppose que oui!
Bob: Est-ce que tu veux faire des choix?
~ choices
- Non merci [if GameState.hasChosenNotToMakeChoices == false]
Bob: Petit chenapan! Tu viens d'en faire un, tu m'a l'air d'un sacré loustic, allez file avant que je t'oublies
set GameState.hasChosenNotToMakeChoices = true
@@ -23,7 +24,9 @@ Bob: Est-ce que tu veux faire des choix?
- Pardon? J'ai mal entendu [if GameState.playerIsDeaf == false]
set GameState.playerIsDeaf = true
=> start
- Oula! je'm'casse!
- Oula! je'm'casse! => after_choices
=> choices
~ after_choices
if GameState.hasChosenToMakeChoices == true and GameState.hasChosenNotToMakeChoices == true
=> next_dialogue
=> END

View File

@@ -25,14 +25,17 @@ func _unhandled_input(event: InputEvent) -> void:
human.wants_to_grab = true
# moving using either touch or mouse button
if event is InputEventMouseButton or event is InputEventScreenTouch:
if event.is_action_pressed("touch") or event is InputEventScreenTouch:
GameState.isUsingTouch = true
var tile_pos = world.local_to_map(world.to_local(get_global_mouse_position()))
if event.pressed:
if event.is_pressed():
pathFinder.destination = get_global_mouse_position()
func _process(delta) -> void:
func update_game_state():
GameState.player_positions = human.get_feet_global_position()
func _process(delta) -> void:
update_game_state()
ray.target_position = human.last_facing_direction * 48
if human.last_facing_direction.y > 0 :

View File

@@ -7,7 +7,7 @@ var player: Human
var hasMouseInside = false
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseButton or event is InputEventScreenTouch:
if event.is_action_pressed("touch") or event is InputEventScreenTouch:
if event.pressed:
if clueEnabled:
if hasMouseInside:

View File

@@ -78,6 +78,11 @@ menu={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
touch={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
]
}
[internationalization]