la souris fait bouger qu'au clic gauche
This commit is contained in:
@@ -14,6 +14,7 @@ else:
|
|||||||
Bob: Est-ce que tu connais les contrôles du jeu?
|
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: 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?
|
Bob: Est-ce que tu veux faire des choix?
|
||||||
|
~ choices
|
||||||
- Non merci [if GameState.hasChosenNotToMakeChoices == false]
|
- 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
|
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
|
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]
|
- Pardon? J'ai mal entendu [if GameState.playerIsDeaf == false]
|
||||||
set GameState.playerIsDeaf = true
|
set GameState.playerIsDeaf = true
|
||||||
=> start
|
=> start
|
||||||
- Oula! je'm'casse!
|
- Oula! je'm'casse! => after_choices
|
||||||
|
=> choices
|
||||||
|
~ after_choices
|
||||||
if GameState.hasChosenToMakeChoices == true and GameState.hasChosenNotToMakeChoices == true
|
if GameState.hasChosenToMakeChoices == true and GameState.hasChosenNotToMakeChoices == true
|
||||||
=> next_dialogue
|
=> next_dialogue
|
||||||
=> END
|
=> END
|
||||||
|
|||||||
@@ -25,14 +25,17 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
human.wants_to_grab = true
|
human.wants_to_grab = true
|
||||||
|
|
||||||
# moving using either touch or mouse button
|
# 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
|
GameState.isUsingTouch = true
|
||||||
var tile_pos = world.local_to_map(world.to_local(get_global_mouse_position()))
|
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()
|
pathFinder.destination = get_global_mouse_position()
|
||||||
|
|
||||||
|
func update_game_state():
|
||||||
|
GameState.player_positions = human.get_feet_global_position()
|
||||||
|
|
||||||
func _process(delta) -> void:
|
func _process(delta) -> void:
|
||||||
GameState.player_positions = human.get_feet_global_position()
|
update_game_state()
|
||||||
ray.target_position = human.last_facing_direction * 48
|
ray.target_position = human.last_facing_direction * 48
|
||||||
|
|
||||||
if human.last_facing_direction.y > 0 :
|
if human.last_facing_direction.y > 0 :
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var player: Human
|
|||||||
var hasMouseInside = false
|
var hasMouseInside = false
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
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 event.pressed:
|
||||||
if clueEnabled:
|
if clueEnabled:
|
||||||
if hasMouseInside:
|
if hasMouseInside:
|
||||||
|
|||||||
@@ -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)
|
"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]
|
[internationalization]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user