add android export with swipe gestures
This commit is contained in:
parent
84d6354f35
commit
df97221788
BIN
game/android/debug.keystore
Normal file
BIN
game/android/debug.keystore
Normal file
Binary file not shown.
197
game/export_presets.cfg
Normal file
197
game/export_presets.cfg
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
[preset.0]
|
||||||
|
|
||||||
|
name="Android"
|
||||||
|
platform="Android"
|
||||||
|
runnable=true
|
||||||
|
custom_features=""
|
||||||
|
export_filter="all_resources"
|
||||||
|
include_filter=""
|
||||||
|
exclude_filter=""
|
||||||
|
export_path=""
|
||||||
|
patch_list=PoolStringArray( )
|
||||||
|
script_export_mode=1
|
||||||
|
script_encryption_key=""
|
||||||
|
|
||||||
|
[preset.0.options]
|
||||||
|
|
||||||
|
graphics/32_bits_framebuffer=true
|
||||||
|
one_click_deploy/clear_previous_install=false
|
||||||
|
custom_package/debug=""
|
||||||
|
custom_package/release=""
|
||||||
|
command_line/extra_args=""
|
||||||
|
version/code=1
|
||||||
|
version/name="1.0"
|
||||||
|
package/unique_name="com.ffreling.taqin"
|
||||||
|
package/name="Taqin"
|
||||||
|
package/signed=true
|
||||||
|
screen/immersive_mode=true
|
||||||
|
screen/orientation=1
|
||||||
|
screen/support_small=true
|
||||||
|
screen/support_normal=true
|
||||||
|
screen/support_large=true
|
||||||
|
screen/support_xlarge=true
|
||||||
|
screen/opengl_debug=false
|
||||||
|
launcher_icons/xxxhdpi_192x192=""
|
||||||
|
launcher_icons/xxhdpi_144x144=""
|
||||||
|
launcher_icons/xhdpi_96x96=""
|
||||||
|
launcher_icons/hdpi_72x72=""
|
||||||
|
launcher_icons/mdpi_48x48=""
|
||||||
|
keystore/debug=""
|
||||||
|
keystore/debug_user=""
|
||||||
|
keystore/debug_password=""
|
||||||
|
keystore/release=""
|
||||||
|
keystore/release_user=""
|
||||||
|
keystore/release_password=""
|
||||||
|
apk_expansion/enable=false
|
||||||
|
apk_expansion/SALT=""
|
||||||
|
apk_expansion/public_key=""
|
||||||
|
architectures/armeabi-v7a=true
|
||||||
|
architectures/arm64-v8a=true
|
||||||
|
architectures/x86=false
|
||||||
|
architectures/x86_64=false
|
||||||
|
permissions/custom_permissions=PoolStringArray( )
|
||||||
|
permissions/access_checkin_properties=false
|
||||||
|
permissions/access_coarse_location=false
|
||||||
|
permissions/access_fine_location=false
|
||||||
|
permissions/access_location_extra_commands=false
|
||||||
|
permissions/access_mock_location=false
|
||||||
|
permissions/access_network_state=false
|
||||||
|
permissions/access_surface_flinger=false
|
||||||
|
permissions/access_wifi_state=false
|
||||||
|
permissions/account_manager=false
|
||||||
|
permissions/add_voicemail=false
|
||||||
|
permissions/authenticate_accounts=false
|
||||||
|
permissions/battery_stats=false
|
||||||
|
permissions/bind_accessibility_service=false
|
||||||
|
permissions/bind_appwidget=false
|
||||||
|
permissions/bind_device_admin=false
|
||||||
|
permissions/bind_input_method=false
|
||||||
|
permissions/bind_nfc_service=false
|
||||||
|
permissions/bind_notification_listener_service=false
|
||||||
|
permissions/bind_print_service=false
|
||||||
|
permissions/bind_remoteviews=false
|
||||||
|
permissions/bind_text_service=false
|
||||||
|
permissions/bind_vpn_service=false
|
||||||
|
permissions/bind_wallpaper=false
|
||||||
|
permissions/bluetooth=false
|
||||||
|
permissions/bluetooth_admin=false
|
||||||
|
permissions/bluetooth_privileged=false
|
||||||
|
permissions/brick=false
|
||||||
|
permissions/broadcast_package_removed=false
|
||||||
|
permissions/broadcast_sms=false
|
||||||
|
permissions/broadcast_sticky=false
|
||||||
|
permissions/broadcast_wap_push=false
|
||||||
|
permissions/call_phone=false
|
||||||
|
permissions/call_privileged=false
|
||||||
|
permissions/camera=false
|
||||||
|
permissions/capture_audio_output=false
|
||||||
|
permissions/capture_secure_video_output=false
|
||||||
|
permissions/capture_video_output=false
|
||||||
|
permissions/change_component_enabled_state=false
|
||||||
|
permissions/change_configuration=false
|
||||||
|
permissions/change_network_state=false
|
||||||
|
permissions/change_wifi_multicast_state=false
|
||||||
|
permissions/change_wifi_state=false
|
||||||
|
permissions/clear_app_cache=false
|
||||||
|
permissions/clear_app_user_data=false
|
||||||
|
permissions/control_location_updates=false
|
||||||
|
permissions/delete_cache_files=false
|
||||||
|
permissions/delete_packages=false
|
||||||
|
permissions/device_power=false
|
||||||
|
permissions/diagnostic=false
|
||||||
|
permissions/disable_keyguard=false
|
||||||
|
permissions/dump=false
|
||||||
|
permissions/expand_status_bar=false
|
||||||
|
permissions/factory_test=false
|
||||||
|
permissions/flashlight=false
|
||||||
|
permissions/force_back=false
|
||||||
|
permissions/get_accounts=false
|
||||||
|
permissions/get_package_size=false
|
||||||
|
permissions/get_tasks=false
|
||||||
|
permissions/get_top_activity_info=false
|
||||||
|
permissions/global_search=false
|
||||||
|
permissions/hardware_test=false
|
||||||
|
permissions/inject_events=false
|
||||||
|
permissions/install_location_provider=false
|
||||||
|
permissions/install_packages=false
|
||||||
|
permissions/install_shortcut=false
|
||||||
|
permissions/internal_system_window=false
|
||||||
|
permissions/internet=false
|
||||||
|
permissions/kill_background_processes=false
|
||||||
|
permissions/location_hardware=false
|
||||||
|
permissions/manage_accounts=false
|
||||||
|
permissions/manage_app_tokens=false
|
||||||
|
permissions/manage_documents=false
|
||||||
|
permissions/master_clear=false
|
||||||
|
permissions/media_content_control=false
|
||||||
|
permissions/modify_audio_settings=false
|
||||||
|
permissions/modify_phone_state=false
|
||||||
|
permissions/mount_format_filesystems=false
|
||||||
|
permissions/mount_unmount_filesystems=false
|
||||||
|
permissions/nfc=false
|
||||||
|
permissions/persistent_activity=false
|
||||||
|
permissions/process_outgoing_calls=false
|
||||||
|
permissions/read_calendar=false
|
||||||
|
permissions/read_call_log=false
|
||||||
|
permissions/read_contacts=false
|
||||||
|
permissions/read_external_storage=false
|
||||||
|
permissions/read_frame_buffer=false
|
||||||
|
permissions/read_history_bookmarks=false
|
||||||
|
permissions/read_input_state=false
|
||||||
|
permissions/read_logs=false
|
||||||
|
permissions/read_phone_state=false
|
||||||
|
permissions/read_profile=false
|
||||||
|
permissions/read_sms=false
|
||||||
|
permissions/read_social_stream=false
|
||||||
|
permissions/read_sync_settings=false
|
||||||
|
permissions/read_sync_stats=false
|
||||||
|
permissions/read_user_dictionary=false
|
||||||
|
permissions/reboot=false
|
||||||
|
permissions/receive_boot_completed=false
|
||||||
|
permissions/receive_mms=false
|
||||||
|
permissions/receive_sms=false
|
||||||
|
permissions/receive_wap_push=false
|
||||||
|
permissions/record_audio=false
|
||||||
|
permissions/reorder_tasks=false
|
||||||
|
permissions/restart_packages=false
|
||||||
|
permissions/send_respond_via_message=false
|
||||||
|
permissions/send_sms=false
|
||||||
|
permissions/set_activity_watcher=false
|
||||||
|
permissions/set_alarm=false
|
||||||
|
permissions/set_always_finish=false
|
||||||
|
permissions/set_animation_scale=false
|
||||||
|
permissions/set_debug_app=false
|
||||||
|
permissions/set_orientation=false
|
||||||
|
permissions/set_pointer_speed=false
|
||||||
|
permissions/set_preferred_applications=false
|
||||||
|
permissions/set_process_limit=false
|
||||||
|
permissions/set_time=false
|
||||||
|
permissions/set_time_zone=false
|
||||||
|
permissions/set_wallpaper=false
|
||||||
|
permissions/set_wallpaper_hints=false
|
||||||
|
permissions/signal_persistent_processes=false
|
||||||
|
permissions/status_bar=false
|
||||||
|
permissions/subscribed_feeds_read=false
|
||||||
|
permissions/subscribed_feeds_write=false
|
||||||
|
permissions/system_alert_window=false
|
||||||
|
permissions/transmit_ir=false
|
||||||
|
permissions/uninstall_shortcut=false
|
||||||
|
permissions/update_device_stats=false
|
||||||
|
permissions/use_credentials=false
|
||||||
|
permissions/use_sip=false
|
||||||
|
permissions/vibrate=false
|
||||||
|
permissions/wake_lock=false
|
||||||
|
permissions/write_apn_settings=false
|
||||||
|
permissions/write_calendar=false
|
||||||
|
permissions/write_call_log=false
|
||||||
|
permissions/write_contacts=false
|
||||||
|
permissions/write_external_storage=false
|
||||||
|
permissions/write_gservices=false
|
||||||
|
permissions/write_history_bookmarks=false
|
||||||
|
permissions/write_profile=false
|
||||||
|
permissions/write_secure_settings=false
|
||||||
|
permissions/write_settings=false
|
||||||
|
permissions/write_sms=false
|
||||||
|
permissions/write_social_stream=false
|
||||||
|
permissions/write_sync_settings=false
|
||||||
|
permissions/write_user_dictionary=false
|
|
@ -29,10 +29,16 @@ _global_script_class_icons={
|
||||||
config/name="Taqin"
|
config/name="Taqin"
|
||||||
run/main_scene="res://src/Main.tscn"
|
run/main_scene="res://src/Main.tscn"
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
run/main_scene.mobile="res://src/MainMobile.tscn"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/size/resizable=false
|
window/size/resizable=false
|
||||||
|
window/handheld/orientation.mobile="portrait"
|
||||||
|
window/size/width.mobile=600
|
||||||
|
window/size/height.mobile=1200
|
||||||
|
window/stretch/mode.mobile="2d"
|
||||||
|
window/stretch/aspect.mobile="expand"
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|
20
game/src/MainMobile.tscn
Normal file
20
game/src/MainMobile.tscn
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://src/Main.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://src/Taquin.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
[node name="Main" type="Control"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Taquin" parent="." instance=ExtResource( 2 )]
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
margin_left = -270.0
|
||||||
|
margin_top = -280.0
|
||||||
|
margin_right = 270.0
|
||||||
|
margin_bottom = 280.0
|
||||||
|
[connection signal="solved" from="Taquin" to="." method="_on_Taquin_solved"]
|
|
@ -21,6 +21,8 @@ var rng = RandomNumberGenerator.new()
|
||||||
|
|
||||||
var current_animation_path: String = "AnimationPlayer/MockPiece:position"
|
var current_animation_path: String = "AnimationPlayer/MockPiece:position"
|
||||||
|
|
||||||
|
var swipe = Vector2(0, 0)
|
||||||
|
|
||||||
func position_for_index(index: Vector2, size: int) -> Vector2:
|
func position_for_index(index: Vector2, size: int) -> Vector2:
|
||||||
return Vector2(padding + index.x * (size + interpiece), padding + index.y * (size + interpiece))
|
return Vector2(padding + index.x * (size + interpiece), padding + index.y * (size + interpiece))
|
||||||
|
|
||||||
|
@ -76,6 +78,20 @@ func _input(event):
|
||||||
if event.is_action_pressed("ui_right"):
|
if event.is_action_pressed("ui_right"):
|
||||||
move_piece(Direction.LEFT)
|
move_piece(Direction.LEFT)
|
||||||
|
|
||||||
|
if event is InputEventScreenDrag:
|
||||||
|
swipe = event.relative
|
||||||
|
if event is InputEventScreenTouch:
|
||||||
|
if not event.pressed: # Touch released
|
||||||
|
var angle = swipe.angle()
|
||||||
|
if angle < PI / 4 and angle >= - PI / 4:
|
||||||
|
move_piece(Direction.LEFT)
|
||||||
|
if angle >= PI / 4 and angle < PI - PI / 4:
|
||||||
|
move_piece(Direction.UP)
|
||||||
|
if angle >= - PI + PI / 4 and angle < - PI / 4:
|
||||||
|
move_piece(Direction.DOWN)
|
||||||
|
if angle >= PI - PI / 4 or angle < -PI + PI / 4:
|
||||||
|
move_piece(Direction.RIGHT)
|
||||||
|
|
||||||
enum Direction { UP, DOWN, LEFT, RIGHT }
|
enum Direction { UP, DOWN, LEFT, RIGHT }
|
||||||
|
|
||||||
func move_piece(direction) -> bool:
|
func move_piece(direction) -> bool:
|
||||||
|
|
Loading…
Reference in a new issue