mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 15:00:09 +01:00
Add touch screen support for 3d/platformer (#1128)
Update touch_screen_ui.gd
This commit is contained in:
@@ -71,7 +71,6 @@ func _physics_process(delta: float) -> void:
|
||||
movement_direction = movement_direction.normalized()
|
||||
|
||||
var jump_attempt := Input.is_action_pressed(&"jump")
|
||||
var shoot_attempt := Input.is_action_pressed(&"shoot")
|
||||
|
||||
if is_on_floor():
|
||||
var sharp_turn := horizontal_speed > 0.1 and \
|
||||
@@ -154,7 +153,7 @@ func _physics_process(delta: float) -> void:
|
||||
shoot_blend *= 0.97
|
||||
if (shoot_blend < 0):
|
||||
shoot_blend = 0
|
||||
|
||||
var shoot_attempt := Input.is_action_pressed(&"shoot")
|
||||
if shoot_attempt and not prev_shoot:
|
||||
shoot_blend = SHOOT_TIME
|
||||
var bullet := preload("res://player/bullet/bullet.tscn").instantiate() as Bullet
|
||||
|
||||
Reference in New Issue
Block a user