From f5da59dbbc0b8917695fc32c6142b63088e685ef Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sat, 4 Dec 2021 22:46:38 +0300 Subject: [PATCH 01/13] add early tap-attack permission --- RandomForest/RandomForest.yyp | 7 ++ .../options/android/options_android.yy | 76 +++++++++++++++++++ RandomForest/options/html5/options_html5.yy | 34 +++++++++ RandomForest/options/ios/options_ios.yy | 50 ++++++++++++ RandomForest/options/linux/options_linux.yy | 25 ++++++ RandomForest/options/mac/options_mac.yy | 33 ++++++++ RandomForest/options/tvos/options_tvos.yy | 29 +++++++ .../options/windowsuap/options_windowsuap.yy | 61 +++++++++++++++ .../funPlayerTapToEmptyPlace.gml | 2 + .../scriptPlayerTeleportState.gml | 1 + 10 files changed, 318 insertions(+) create mode 100644 RandomForest/options/android/options_android.yy create mode 100644 RandomForest/options/html5/options_html5.yy create mode 100644 RandomForest/options/ios/options_ios.yy create mode 100644 RandomForest/options/linux/options_linux.yy create mode 100644 RandomForest/options/mac/options_mac.yy create mode 100644 RandomForest/options/tvos/options_tvos.yy create mode 100644 RandomForest/options/windowsuap/options_windowsuap.yy diff --git a/RandomForest/RandomForest.yyp b/RandomForest/RandomForest.yyp index d204738..f62349e 100644 --- a/RandomForest/RandomForest.yyp +++ b/RandomForest/RandomForest.yyp @@ -193,6 +193,13 @@ {"name":"Main","path":"options/main/options_main.yy",}, {"name":"Windows","path":"options/windows/options_windows.yy",}, {"name":"operagx","path":"options/operagx/options_operagx.yy",}, + {"name":"Android","path":"options/android/options_android.yy",}, + {"name":"HTML5","path":"options/html5/options_html5.yy",}, + {"name":"iOS","path":"options/ios/options_ios.yy",}, + {"name":"Linux","path":"options/linux/options_linux.yy",}, + {"name":"macOS","path":"options/mac/options_mac.yy",}, + {"name":"tvOS","path":"options/tvos/options_tvos.yy",}, + {"name":"Windows UWP","path":"options/windowsuap/options_windowsuap.yy",}, ], "isDnDProject": false, "isEcma": false, diff --git a/RandomForest/options/android/options_android.yy b/RandomForest/options/android/options_android.yy new file mode 100644 index 0000000..099a009 --- /dev/null +++ b/RandomForest/options/android/options_android.yy @@ -0,0 +1,76 @@ +{ + "option_android_sync_amazon": false, + "option_android_display_name": "Created with GameMaker Studio 2", + "option_android_version": "1.0.0.0", + "option_android_tools_from_version": false, + "option_android_build_tools": "", + "option_android_support_lib": "", + "option_android_target_sdk": "", + "option_android_minimum_sdk": "", + "option_android_compile_sdk": "", + "option_android_package_domain": "com", + "option_android_package_company": "company", + "option_android_package_product": "game", + "option_android_arch_armv7": false, + "option_android_arch_x86": false, + "option_android_arch_arm64": true, + "option_android_arch_x86_64": false, + "option_android_orient_portrait": true, + "option_android_orient_portrait_flipped": true, + "option_android_orient_landscape": true, + "option_android_orient_landscape_flipped": true, + "option_android_gamepad_support": true, + "option_android_lint": false, + "option_android_install_location": 0, + "option_android_sleep_margin": 4, + "option_android_splash_screens_landscape": "${base_options_dir}/android/splash/landscape.png", + "option_android_splash_screens_portrait": "${base_options_dir}/android/splash/portrait.png", + "option_android_splash_time": 0, + "option_android_launchscreen_fill": 0, + "option_android_splashscreen_background_colour": 255, + "option_android_tv_banner": "${base_options_dir}/android/tv_banner.png", + "option_android_interpolate_pixels": false, + "option_android_screen_depth": 0, + "option_android_device_support": 0, + "option_android_scale": 0, + "option_android_texture_page": "2048x2048", + "option_android_icon_ldpi": "${base_options_dir}/android/icons/ldpi.png", + "option_android_icon_mdpi": "${base_options_dir}/android/icons/mdpi.png", + "option_android_icon_hdpi": "${base_options_dir}/android/icons/hdpi.png", + "option_android_icon_xhdpi": "${base_options_dir}/android/icons/xhdpi.png", + "option_android_icon_xxhdpi": "${base_options_dir}/android/icons/xxhdpi.png", + "option_android_icon_xxxhdpi": "${base_options_dir}/android/icons/xxxhdpi.png", + "option_android_icon_adaptive_generate": false, + "option_android_icon_adaptive_ldpi": "${base_options_dir}/android/icons_adaptive/ldpi.png", + "option_android_icon_adaptive_mdpi": "${base_options_dir}/android/icons_adaptive/mdpi.png", + "option_android_icon_adaptive_hdpi": "${base_options_dir}/android/icons_adaptive/hdpi.png", + "option_android_icon_adaptive_xhdpi": "${base_options_dir}/android/icons_adaptive/xhdpi.png", + "option_android_icon_adaptive_xxhdpi": "${base_options_dir}/android/icons_adaptive/xxhdpi.png", + "option_android_icon_adaptive_xxxhdpi": "${base_options_dir}/android/icons_adaptive/xxxhdpi.png", + "option_android_icon_adaptivebg_ldpi": "${base_options_dir}/android/icons_adaptivebg/ldpi.png", + "option_android_icon_adaptivebg_mdpi": "${base_options_dir}/android/icons_adaptivebg/mdpi.png", + "option_android_icon_adaptivebg_hdpi": "${base_options_dir}/android/icons_adaptivebg/hdpi.png", + "option_android_icon_adaptivebg_xhdpi": "${base_options_dir}/android/icons_adaptivebg/xhdpi.png", + "option_android_icon_adaptivebg_xxhdpi": "${base_options_dir}/android/icons_adaptivebg/xxhdpi.png", + "option_android_icon_adaptivebg_xxxhdpi": "${base_options_dir}/android/icons_adaptivebg/xxxhdpi.png", + "option_android_use_facebook": false, + "option_android_facebook_id": "", + "option_android_facebook_app_display_name": "", + "option_android_google_cloud_saving": false, + "option_android_google_services_app_id": "", + "option_android_permission_write_external_storage": false, + "option_android_permission_read_phone_state": false, + "option_android_permission_network_state": false, + "option_android_permission_internet": true, + "option_android_permission_bluetooth": true, + "option_android_permission_record_audio": false, + "option_android_application_tag_inject": "", + "option_android_google_apk_expansion": false, + "option_android_google_dynamic_asset_delivery": false, + "option_android_google_licensing_public_key": "", + "option_android_tv_isgame": true, + "resourceVersion": "1.0", + "name": "Android", + "tags": [], + "resourceType": "GMAndroidOptions", +} \ No newline at end of file diff --git a/RandomForest/options/html5/options_html5.yy b/RandomForest/options/html5/options_html5.yy new file mode 100644 index 0000000..9b43ef0 --- /dev/null +++ b/RandomForest/options/html5/options_html5.yy @@ -0,0 +1,34 @@ +{ + "option_html5_browser_title": "Created with GameMaker Studio 2", + "option_html5_version": "1.0.0.0", + "option_html5_foldername": "html5game", + "option_html5_outputname": "index.html", + "option_html5_splash_png": "${base_options_dir}/html5/splash.png", + "option_html5_usesplash": false, + "option_html5_outputdebugtoconsole": true, + "option_html5_display_cursor": true, + "option_html5_localrunalert": true, + "option_html5_index": "", + "option_html5_loadingbar": "", + "option_html5_jsprepend": "", + "option_html5_icon": "${base_options_dir}/html5/fav.ico", + "option_html5_allow_fullscreen": true, + "option_html5_interpolate_pixels": true, + "option_html5_centregame": false, + "option_html5_usebuiltinparticles": true, + "option_html5_usebuiltinfont": true, + "option_html5_webgl": 2, + "option_html5_scale": 0, + "option_html5_texture_page": "2048x2048", + "option_html5_use_facebook": false, + "option_html5_facebook_id": "", + "option_html5_facebook_app_display_name": "", + "option_html5_flurry_enable": false, + "option_html5_flurry_id": "", + "option_html5_google_analytics_enable": false, + "option_html5_google_tracking_id": "", + "resourceVersion": "1.0", + "name": "HTML5", + "tags": [], + "resourceType": "GMHtml5Options", +} \ No newline at end of file diff --git a/RandomForest/options/ios/options_ios.yy b/RandomForest/options/ios/options_ios.yy new file mode 100644 index 0000000..1498dc4 --- /dev/null +++ b/RandomForest/options/ios/options_ios.yy @@ -0,0 +1,50 @@ +{ + "option_ios_display_name": "Created with GameMaker Studio 2", + "option_ios_bundle_name": "com.company.game", + "option_ios_version": "1.0.0.0", + "option_ios_output_dir": "~/gamemakerstudio2", + "option_ios_team_id": "", + "option_ios_orientation_portrait": true, + "option_ios_orientation_portrait_flipped": true, + "option_ios_orientation_landscape": true, + "option_ios_orientation_landscape_flipped": true, + "option_ios_devices": 2, + "option_ios_defer_home_indicator": false, + "option_ios_icon_iphone_app_120": "${base_options_dir}/ios/icons/app/iphone_120.png", + "option_ios_icon_iphone_app_180": "${base_options_dir}/ios/icons/app/iphone_180.png", + "option_ios_icon_ipad_app_76": "${base_options_dir}/ios/icons/app/ipad_76.png", + "option_ios_icon_ipad_app_152": "${base_options_dir}/ios/icons/app/ipad_152.png", + "option_ios_icon_ipad_pro_app_167": "${base_options_dir}/ios/icons/app/ipad_pro_167.png", + "option_ios_icon_iphone_notification_40": "${base_options_dir}/ios/icons/notification/iphone_40.png", + "option_ios_icon_iphone_notification_60": "${base_options_dir}/ios/icons/notification/iphone_60.png", + "option_ios_icon_ipad_notification_20": "${base_options_dir}/ios/icons/notification/ipad_20.png", + "option_ios_icon_ipad_notification_40": "${base_options_dir}/ios/icons/notification/ipad_40.png", + "option_ios_icon_iphone_spotlight_80": "${base_options_dir}/ios/icons/spotlight/iphone_80.png", + "option_ios_icon_iphone_spotlight_120": "${base_options_dir}/ios/icons/spotlight/iphone_120.png", + "option_ios_icon_ipad_spotlight_40": "${base_options_dir}/ios/icons/spotlight/ipad_40.png", + "option_ios_icon_ipad_spotlight_80": "${base_options_dir}/ios/icons/spotlight/ipad_80.png", + "option_ios_icon_iphone_settings_58": "${base_options_dir}/ios/icons/settings/iphone_58.png", + "option_ios_icon_iphone_settings_87": "${base_options_dir}/ios/icons/settings/iphone_87.png", + "option_ios_icon_ipad_settings_29": "${base_options_dir}/ios/icons/settings/ipad_29.png", + "option_ios_icon_ipad_settings_58": "${base_options_dir}/ios/icons/settings/ipad_58.png", + "option_ios_icon_itunes_artwork_1024": "${base_options_dir}/ios/icons/itunes/itunes_1024.png", + "option_ios_splashscreen_background_colour": 255, + "option_ios_launchscreen_image": "${base_options_dir}/ios/splash/launchscreen.png", + "option_ios_launchscreen_image_landscape": "${base_options_dir}/ios/splash/launchscreen-landscape.png", + "option_ios_launchscreen_fill": 0, + "option_ios_interpolate_pixels": false, + "option_ios_half_ipad1_textures": false, + "option_ios_scale": 0, + "option_ios_texture_page": "2048x2048", + "option_ios_use_facebook": false, + "option_ios_facebook_id": "", + "option_ios_facebook_app_display_name": "", + "option_ios_push_notifications": false, + "option_ios_apple_sign_in": false, + "option_ios_podfile_path": "${options_dir}/ios/Podfile", + "option_ios_podfile_lock_path": "${options_dir}/ios/Podfile.lock", + "resourceVersion": "1.3", + "name": "iOS", + "tags": [], + "resourceType": "GMiOSOptions", +} \ No newline at end of file diff --git a/RandomForest/options/linux/options_linux.yy b/RandomForest/options/linux/options_linux.yy new file mode 100644 index 0000000..4978896 --- /dev/null +++ b/RandomForest/options/linux/options_linux.yy @@ -0,0 +1,25 @@ +{ + "option_linux_display_name": "Created with GameMaker Studio 2", + "option_linux_version": "1.0.0.0", + "option_linux_maintainer_email": "", + "option_linux_homepage": "http://www.yoyogames.com", + "option_linux_short_desc": "", + "option_linux_long_desc": "", + "option_linux_splash_screen": "${base_options_dir}/linux/splash/splash.png", + "option_linux_display_splash": false, + "option_linux_icon": "${base_options_dir}/linux/icons/64.png", + "option_linux_start_fullscreen": false, + "option_linux_allow_fullscreen": false, + "option_linux_interpolate_pixels": true, + "option_linux_display_cursor": true, + "option_linux_sync": false, + "option_linux_resize_window": false, + "option_linux_scale": 0, + "option_linux_texture_page": "2048x2048", + "option_linux_enable_steam": false, + "option_linux_disable_sandbox": false, + "resourceVersion": "1.0", + "name": "Linux", + "tags": [], + "resourceType": "GMLinuxOptions", +} \ No newline at end of file diff --git a/RandomForest/options/mac/options_mac.yy b/RandomForest/options/mac/options_mac.yy new file mode 100644 index 0000000..73e249f --- /dev/null +++ b/RandomForest/options/mac/options_mac.yy @@ -0,0 +1,33 @@ +{ + "option_mac_display_name": "Created with GameMaker Studio 2", + "option_mac_app_id": "com.company.game", + "option_mac_version": "1.0.0.0", + "option_mac_output_dir": "~/gamemakerstudio2", + "option_mac_team_id": "", + "option_mac_signing_identity": "Developer ID Application:", + "option_mac_copyright": "", + "option_mac_splash_png": "${base_options_dir}/mac/splash/splash.png", + "option_mac_icon_png": "${base_options_dir}/mac/icons/1024.png", + "option_mac_installer_background_png": "${base_options_dir}/mac/splash/installer_background.png", + "option_mac_menu_dock": false, + "option_mac_display_cursor": true, + "option_mac_start_fullscreen": false, + "option_mac_allow_fullscreen": false, + "option_mac_interpolate_pixels": true, + "option_mac_vsync": false, + "option_mac_resize_window": false, + "option_mac_enable_retina": false, + "option_mac_scale": 0, + "option_mac_texture_page": "2048x2048", + "option_mac_build_app_store": false, + "option_mac_allow_incoming_network": false, + "option_mac_allow_outgoing_network": false, + "option_mac_app_category": "Games", + "option_mac_enable_steam": false, + "option_mac_disable_sandbox": false, + "option_mac_apple_sign_in": false, + "resourceVersion": "1.0", + "name": "macOS", + "tags": [], + "resourceType": "GMMacOptions", +} \ No newline at end of file diff --git a/RandomForest/options/tvos/options_tvos.yy b/RandomForest/options/tvos/options_tvos.yy new file mode 100644 index 0000000..5ee2c44 --- /dev/null +++ b/RandomForest/options/tvos/options_tvos.yy @@ -0,0 +1,29 @@ +{ + "option_tvos_display_name": "Made in GameMaker Studio 2", + "option_tvos_bundle_name": "com.company.game", + "option_tvos_version": "1.0.0.0", + "option_tvos_output_dir": "~/GameMakerStudio2/tvOS", + "option_tvos_team_id": "", + "option_tvos_icon_400": "${base_options_dir}/tvos/icons/400.png", + "option_tvos_icon_400_2x": "${base_options_dir}/tvos/icons/400_2x.png", + "option_tvos_icon_1280": "${base_options_dir}/tvos/icons/1280.png", + "option_tvos_topshelf": "${base_options_dir}/tvos/topshelf/topshelf.png", + "option_tvos_topshelf_2x": "${base_options_dir}/tvos/topshelf/topshelf_2x.png", + "option_tvos_topshelf_wide": "${base_options_dir}/tvos/topshelf/topshelf_wide.png", + "option_tvos_topshelf_wide_2x": "${base_options_dir}/tvos/topshelf/topshelf_wide_2x.png", + "option_tvos_splashscreen": "${base_options_dir}/tvos/splash/splash.png", + "option_tvos_splashscreen_2x": "${base_options_dir}/tvos/splash/splash_2x.png", + "option_tvos_splash_time": 0, + "option_tvos_interpolate_pixels": true, + "option_tvos_scale": 0, + "option_tvos_texture_page": "2048x2048", + "option_tvos_display_cursor": false, + "option_tvos_push_notifications": false, + "option_tvos_apple_sign_in": false, + "option_tvos_podfile_path": "${options_dir}\\tvos\\Podfile", + "option_tvos_podfile_lock_path": "${options_dir}\\tvos\\Podfile.lock", + "resourceVersion": "1.3", + "name": "tvOS", + "tags": [], + "resourceType": "GMtvOSOptions", +} \ No newline at end of file diff --git a/RandomForest/options/windowsuap/options_windowsuap.yy b/RandomForest/options/windowsuap/options_windowsuap.yy new file mode 100644 index 0000000..4db5f75 --- /dev/null +++ b/RandomForest/options/windowsuap/options_windowsuap.yy @@ -0,0 +1,61 @@ +{ + "option_windowsuap_display_name": "Created with GameMaker Studio 2", + "option_windowsuap_package_name": "YourPackageName", + "option_windowsuap_publisher_display_name": "YourPublisherName", + "option_windowsuap_package_display_name": "YourPackageDisplayName", + "option_windowsuap_description": "Your Description", + "option_windowsuap_version": "1.0.0.0", + "option_windowsuap_orient_portrait": true, + "option_windowsuap_orient_portrait_flipped": true, + "option_windowsuap_orient_landscape": true, + "option_windowsuap_orient_landscape_flipped": true, + "option_windowsuap_small_logo": "${base_options_dir}/windowsuap/logos/SmallLogo.scale-100.png", + "option_windowsuap_smallish_logo": "${base_options_dir}/windowsuap/logos/SmallishLogo.scale-100.png", + "option_windowsuap_store_logo": "${base_options_dir}/windowsuap/logos/StoreLogo.scale-100.png", + "option_windowsuap_logo": "${base_options_dir}/windowsuap/logos/Logo.scale-100.png", + "option_windowsuap_logo_background_colour": 4278190080, + "option_windowsuap_logo_foreground_text": 0, + "option_windowsuap_wide_logo": "${base_options_dir}/windowsuap/logos/WideLogo.scale-100.png", + "option_windowsuap_large_logo": "${base_options_dir}/windowsuap/logos/LargeLogo.scale-100.png", + "option_windowsuap_splash_png": "${base_options_dir}/windowsuap/splash/SplashScreen.scale-100.png", + "option_windowsuap_splash_background_colour": 4278190080, + "option_windowsuap_interpolate_pixels": false, + "option_windowsuap_display_cursor": true, + "option_windowsuap_start_fullscreen": false, + "option_windowsuap_allow_fullscreen_switching": false, + "option_windowsuap_use_synchronization": true, + "option_windowsuap_scale": 0, + "option_windowsuap_texture_page": "2048x2048", + "option_windowsuap_certificate_location": "${base_options_dir}\\windowsuap\\keys\\WinUWPRunner_TemporaryKey.pfx", + "option_windowsuap_certificate_publishername": "CN=Sandbox", + "option_windowsuap_native_cpu": 0, + "option_windowsuap_internet_capable": false, + "option_windowsuap_microphone_capable": false, + "option_windowsuap_iap_sandbox": false, + "option_windowsuap_targetdevicefamily_universal": true, + "option_windowsuap_target_platform_version": "10.0.14393.0", + "option_windowsuap_target_platform_min_version": "10.0.14393.0", + "option_windowsuap_targetdevicefamily_desktop": false, + "option_windowsuap_desktop_family_platform_version": "10.0.14393.0", + "option_windowsuap_desktop_family_platform_min_version": "10.0.14393.0", + "option_windowsuap_targetdevicefamily_xbox": false, + "option_windowsuap_xbox_family_platform_version": "10.0.14393.0", + "option_windowsuap_xbox_family_platform_min_version": "10.0.14393.0", + "option_windowsuap_targetdevicefamily_mobile": false, + "option_windowsuap_mobile_family_platform_version": "10.0.14393.0", + "option_windowsuap_mobile_family_platform_min_version": "10.0.14393.0", + "option_windowsuap_targetdevicefamily_holographic": false, + "option_windowsuap_holographic_family_platform_version": "10.0.14393.0", + "option_windowsuap_holographic_family_platform_min_version": "10.0.14393.0", + "option_windowsuap_targetdevicefamily_team": false, + "option_windowsuap_team_family_platform_version": "10.0.14393.0", + "option_windowsuap_team_family_platform_min_version": "10.0.14393.0", + "option_windowsuap_xbox_live": false, + "option_windowsuap_xbox_live_creators_program": false, + "option_windowsuap_xbox_live_title_id": "0", + "option_windowsuap_xbox_live_scid": "00000000-0000-0000-0000-000000000000", + "resourceVersion": "1.0", + "name": "Windows UWP", + "tags": [], + "resourceType": "GMWindowsUAPOptions", +} \ No newline at end of file diff --git a/RandomForest/scripts/funPlayerTapToEmptyPlace/funPlayerTapToEmptyPlace.gml b/RandomForest/scripts/funPlayerTapToEmptyPlace/funPlayerTapToEmptyPlace.gml index 538335e..5c23e44 100644 --- a/RandomForest/scripts/funPlayerTapToEmptyPlace/funPlayerTapToEmptyPlace.gml +++ b/RandomForest/scripts/funPlayerTapToEmptyPlace/funPlayerTapToEmptyPlace.gml @@ -49,6 +49,8 @@ function funPlayerTapToEmptyPlace() { self.y = new_y self.teleport_end_effect = undefined // instance_create_depth(self.x, self.y - abs(self.sprite_height) / 2, self.depth - 1, oTeleportEnd) + + self.tap_attack_countdown_counter = 0 // reset counter } return success_tap diff --git a/RandomForest/scripts/scriptPlayerTeleportState/scriptPlayerTeleportState.gml b/RandomForest/scripts/scriptPlayerTeleportState/scriptPlayerTeleportState.gml index 36b6f60..11d9b6f 100644 --- a/RandomForest/scripts/scriptPlayerTeleportState/scriptPlayerTeleportState.gml +++ b/RandomForest/scripts/scriptPlayerTeleportState/scriptPlayerTeleportState.gml @@ -34,6 +34,7 @@ function funPlayerTeleportLogic() { function funPlayerTeleportEnd() { self.image_alpha = 1 + self.tap_attack_countdown_counter = 0 // reset counter // restore saved state self.current_xspeed = self.old_xspeed From 81143e61be832c5e548cb91bea033344967122ef Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sat, 4 Dec 2021 23:22:45 +0300 Subject: [PATCH 02/13] add debug enabling/disabling --- RandomForest/objects/oDebug/Create_0.gml | 5 ++- RandomForest/objects/oDebug/Step_0.gml | 37 +++++++++++++++++++--- RandomForest/objects/oLoading/Create_0.gml | 2 ++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/RandomForest/objects/oDebug/Create_0.gml b/RandomForest/objects/oDebug/Create_0.gml index ff240a9..86e8b2d 100644 --- a/RandomForest/objects/oDebug/Create_0.gml +++ b/RandomForest/objects/oDebug/Create_0.gml @@ -1 +1,4 @@ -self.frame_counter = 0 \ No newline at end of file +self.frame_counter = 0 + +self.debug_password = "DEBUG" // only CAPSLOCK +self.debug_current_index = 1 // one-indexed \ No newline at end of file diff --git a/RandomForest/objects/oDebug/Step_0.gml b/RandomForest/objects/oDebug/Step_0.gml index 4c98c58..7ebd112 100644 --- a/RandomForest/objects/oDebug/Step_0.gml +++ b/RandomForest/objects/oDebug/Step_0.gml @@ -1,9 +1,38 @@ -if (keyboard_check_pressed(ord("R"))) { +self.frame_counter += 1 + + +// switch to debug mode +if ( keyboard_check_pressed(string_ord_at(self.debug_password, self.debug_current_index)) ) { + self.debug_current_index += 1 +} +if (self.debug_current_index > string_length(self.debug_password)) { + global.is_debug = !global.is_debug + self.debug_current_index = 1 + audio_play_sound(soundCoinCollecting, 0, false) // just because +} + + +// if prod +if (!global.is_debug) { + return +} + +if (keyboard_check_pressed(ord("R"))) { // reset saved level number funResetGeneral() } -if (keyboard_check_pressed(ord("T"))) { +if (keyboard_check_pressed(ord("T"))) { // reset saved time records funResetRecords() } +if (keyboard_check_pressed(ord("N"))) { // to next level + room_goto_next() +} +if (keyboard_check_pressed(ord("P"))) { // to previous level + room_goto_previous() +} +if (keyboard_check_pressed(ord("Q"))) { // auto collect all coins + oCoinCollector.coins_collected = instance_number(oCoin) + instance_destroy(oCoin) +} if (self.frame_counter % 60 == 0) { show_debug_message("current_level: " + string(global.current_level)) @@ -13,6 +42,4 @@ if (self.frame_counter % 60 == 0) { show_debug_message("global.time_records[" + string(i) + "]: " + string(global.time_records[i])) } show_debug_message("\n") -} - -self.frame_counter += 1 \ No newline at end of file +} \ No newline at end of file diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index b6a8e1d..f8b968b 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -44,3 +44,5 @@ global.key_arrow_up = vk_up global.key_arrow_down = vk_down global.key_pause = vk_escape + +global.is_debug = false // prod by default From 90a618f5702886bd81c1d1f9aab3a7bb4ebbb690 Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sat, 4 Dec 2021 23:34:21 +0300 Subject: [PATCH 03/13] add fullscreen mode --- RandomForest/RandomForest.yyp | 1 + RandomForest/objects/oFullscreen/Step_0.gml | 5 +++ .../objects/oFullscreen/oFullscreen.yy | 33 +++++++++++++++++++ RandomForest/objects/oLoading/Alarm_0.gml | 3 -- RandomForest/objects/oLoading/Create_0.gml | 5 +++ RandomForest/rooms/rLevel00/rLevel00.yy | 4 ++- RandomForest/rooms/rLevel01/rLevel01.yy | 4 ++- RandomForest/rooms/rTraining/rTraining.yy | 8 +++-- .../funLoadGameState/funLoadGameState.gml | 3 ++ .../funSaveGameState/funSaveGameState.gml | 5 +++ .../scriptResetStorage/scriptResetStorage.gml | 1 + 11 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 RandomForest/objects/oFullscreen/Step_0.gml create mode 100644 RandomForest/objects/oFullscreen/oFullscreen.yy diff --git a/RandomForest/RandomForest.yyp b/RandomForest/RandomForest.yyp index f62349e..d5fed8a 100644 --- a/RandomForest/RandomForest.yyp +++ b/RandomForest/RandomForest.yyp @@ -164,6 +164,7 @@ {"id":{"name":"tsPlatforms","path":"tilesets/tsPlatforms/tsPlatforms.yy",},"order":0,}, {"id":{"name":"sSpikesExt","path":"sprites/sSpikesExt/sSpikesExt.yy",},"order":12,}, {"id":{"name":"funSlimeDetectCriticalState","path":"scripts/funSlimeDetectCriticalState/funSlimeDetectCriticalState.yy",},"order":3,}, + {"id":{"name":"oFullscreen","path":"objects/oFullscreen/oFullscreen.yy",},"order":7,}, {"id":{"name":"scriptBungaloMoveState","path":"scripts/scriptBungaloMoveState/scriptBungaloMoveState.yy",},"order":5,}, {"id":{"name":"sSkeletonIdle","path":"sprites/sSkeletonIdle/sSkeletonIdle.yy",},"order":0,}, {"id":{"name":"sPlayerFall","path":"sprites/sPlayerFall/sPlayerFall.yy",},"order":4,}, diff --git a/RandomForest/objects/oFullscreen/Step_0.gml b/RandomForest/objects/oFullscreen/Step_0.gml new file mode 100644 index 0000000..fb04cf2 --- /dev/null +++ b/RandomForest/objects/oFullscreen/Step_0.gml @@ -0,0 +1,5 @@ +if (keyboard_check_pressed(global.key_fullscreen)) { + global.is_fullscreen = !global.is_fullscreen + funSaveGameState() + window_set_fullscreen(global.is_fullscreen) +} \ No newline at end of file diff --git a/RandomForest/objects/oFullscreen/oFullscreen.yy b/RandomForest/objects/oFullscreen/oFullscreen.yy new file mode 100644 index 0000000..194b0ea --- /dev/null +++ b/RandomForest/objects/oFullscreen/oFullscreen.yy @@ -0,0 +1,33 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Controllers", + "path": "folders/Objects/Controllers.yy", + }, + "resourceVersion": "1.0", + "name": "oFullscreen", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/RandomForest/objects/oLoading/Alarm_0.gml b/RandomForest/objects/oLoading/Alarm_0.gml index 3f6c268..80d5352 100644 --- a/RandomForest/objects/oLoading/Alarm_0.gml +++ b/RandomForest/objects/oLoading/Alarm_0.gml @@ -2,9 +2,6 @@ window_center() -// Load saved state -funLoadGameState() - // go to next room if (global.is_training_completed) { switch (global.current_level) { diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index f8b968b..0238486 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -1,6 +1,10 @@ /// @description Initializing the game +// Load saved state +funLoadGameState() + //Game window resizing +window_set_fullscreen(global.is_fullscreen) global.scale = 3 var cam = room_get_camera(rLevel00, 0) @@ -44,5 +48,6 @@ global.key_arrow_up = vk_up global.key_arrow_down = vk_down global.key_pause = vk_escape +global.key_fullscreen = ord("F") global.is_debug = false // prod by default diff --git a/RandomForest/rooms/rLevel00/rLevel00.yy b/RandomForest/rooms/rLevel00/rLevel00.yy index 3f03226..4e1c01b 100644 --- a/RandomForest/rooms/rLevel00/rLevel00.yy +++ b/RandomForest/rooms/rLevel00/rLevel00.yy @@ -16,11 +16,12 @@ {"instances":[ {"properties":[],"isDnd":false,"objectId":{"name":"oPauseMenu","path":"objects/oPauseMenu/oPauseMenu.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_1528FD97","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oHealthBar","path":"objects/oHealthBar/oHealthBar.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":24.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_7C77E5EE","tags":[],"resourceType":"GMRInstance",}, - {"properties":[],"isDnd":false,"objectId":{"name":"oCoinCollector","path":"objects/oCoinCollector/oCoinCollector.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":132.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_B4AF569","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oCoinCollector","path":"objects/oCoinCollector/oCoinCollector.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":168.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_B4AF569","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oParallax","path":"objects/oParallax/oParallax.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":48.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_74DDCAD2","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oFadeIn","path":"objects/oFadeIn/oFadeIn.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":72.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_21B78E75","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oTimeCounter","path":"objects/oTimeCounter/oTimeCounter.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":96.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_10B48118","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oDebug","path":"objects/oDebug/oDebug.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":-36.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_4069FE8B","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oFullscreen","path":"objects/oFullscreen/oFullscreen.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":120.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_592E1DD5","tags":[],"resourceType":"GMRInstance",}, ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":12,"gridY":12,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"UI","tags":[],"resourceType":"GMRInstanceLayer",}, {"tilesetId":{"name":"tsPlatforms","path":"tilesets/tsPlatforms/tsPlatforms.yy",},"x":0,"y":0,"tiles":{"SerialiseWidth":42,"SerialiseHeight":25,"TileSerialiseData":[ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -196,6 +197,7 @@ {"name":"inst_6FB111FF","path":"rooms/rLevel00/rLevel00.yy",}, {"name":"inst_10B48118","path":"rooms/rLevel00/rLevel00.yy",}, {"name":"inst_4069FE8B","path":"rooms/rLevel00/rLevel00.yy",}, + {"name":"inst_592E1DD5","path":"rooms/rLevel00/rLevel00.yy",}, ], "inheritCreationOrder": false, "sequenceId": null, diff --git a/RandomForest/rooms/rLevel01/rLevel01.yy b/RandomForest/rooms/rLevel01/rLevel01.yy index 9e87509..8c35455 100644 --- a/RandomForest/rooms/rLevel01/rLevel01.yy +++ b/RandomForest/rooms/rLevel01/rLevel01.yy @@ -17,11 +17,12 @@ {"properties":[],"isDnd":false,"objectId":{"name":"oPauseMenu","path":"objects/oPauseMenu/oPauseMenu.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":24.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_7DFC5C6E","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oCamera","path":"objects/oCamera/oCamera.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":96.0,"y":512.0,"resourceVersion":"1.0","name":"inst_17F400E0","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oHealthBar","path":"objects/oHealthBar/oHealthBar.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_687E06CD","tags":[],"resourceType":"GMRInstance",}, - {"properties":[],"isDnd":false,"objectId":{"name":"oCoinCollector","path":"objects/oCoinCollector/oCoinCollector.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":132.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_4A209D63","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oCoinCollector","path":"objects/oCoinCollector/oCoinCollector.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":156.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_4A209D63","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oParallax","path":"objects/oParallax/oParallax.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":48.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_3277CB99","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oFadeIn","path":"objects/oFadeIn/oFadeIn.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":72.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_3F3754FC","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oTimeCounter","path":"objects/oTimeCounter/oTimeCounter.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":96.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_6A6644EC","tags":[],"resourceType":"GMRInstance",}, {"properties":[],"isDnd":false,"objectId":{"name":"oDebug","path":"objects/oDebug/oDebug.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":-36.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_470DC57F","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oFullscreen","path":"objects/oFullscreen/oFullscreen.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":120.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_5044F00E","tags":[],"resourceType":"GMRInstance",}, ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":12,"gridY":12,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"UI","tags":[],"resourceType":"GMRInstanceLayer",}, {"tilesetId":{"name":"tsPlatforms","path":"tilesets/tsPlatforms/tsPlatforms.yy",},"x":0,"y":0,"tiles":{"SerialiseWidth":82,"SerialiseHeight":47,"TileSerialiseData":[ 2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648,2147483648, @@ -607,6 +608,7 @@ {"name":"inst_3E6940DA","path":"rooms/rLevel01/rLevel01.yy",}, {"name":"inst_6A6644EC","path":"rooms/rLevel01/rLevel01.yy",}, {"name":"inst_470DC57F","path":"rooms/rLevel01/rLevel01.yy",}, + {"name":"inst_5044F00E","path":"rooms/rLevel01/rLevel01.yy",}, ], "inheritCreationOrder": false, "sequenceId": null, diff --git a/RandomForest/rooms/rTraining/rTraining.yy b/RandomForest/rooms/rTraining/rTraining.yy index 104e5cc..713c96f 100644 --- a/RandomForest/rooms/rTraining/rTraining.yy +++ b/RandomForest/rooms/rTraining/rTraining.yy @@ -14,8 +14,10 @@ ], "layers": [ {"instances":[ - {"properties":[],"isDnd":false,"objectId":{"name":"oTraining","path":"objects/oTraining/oTraining.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":-32.0,"resourceVersion":"1.0","name":"inst_61C597DC","tags":[],"resourceType":"GMRInstance",}, - ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Instances","tags":[],"resourceType":"GMRInstanceLayer",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oTraining","path":"objects/oTraining/oTraining.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_61C597DC","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oDebug","path":"objects/oDebug/oDebug.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":-36.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_1043F16F","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"oFullscreen","path":"objects/oFullscreen/oFullscreen.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":24.0,"y":-24.0,"resourceVersion":"1.0","name":"inst_615FD277","tags":[],"resourceType":"GMRInstance",}, + ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":12,"gridY":12,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Instances","tags":[],"resourceType":"GMRInstanceLayer",}, {"spriteId":null,"colour":4278190080,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":true,"resourceVersion":"1.0","name":"Background","tags":[],"resourceType":"GMRBackgroundLayer",}, ], "inheritLayers": false, @@ -23,6 +25,8 @@ "inheritCode": false, "instanceCreationOrder": [ {"name":"inst_61C597DC","path":"rooms/rTraining/rTraining.yy",}, + {"name":"inst_1043F16F","path":"rooms/rTraining/rTraining.yy",}, + {"name":"inst_615FD277","path":"rooms/rTraining/rTraining.yy",}, ], "inheritCreationOrder": false, "sequenceId": null, diff --git a/RandomForest/scripts/funLoadGameState/funLoadGameState.gml b/RandomForest/scripts/funLoadGameState/funLoadGameState.gml index 4d84b9e..963e48d 100644 --- a/RandomForest/scripts/funLoadGameState/funLoadGameState.gml +++ b/RandomForest/scripts/funLoadGameState/funLoadGameState.gml @@ -1,6 +1,9 @@ function funLoadGameState() { ini_open("save.ini") + // fullscreen mode + global.is_fullscreen = ini_read_real("general", "is_fullscreen", 0) // default: false + // current level number global.current_level = ini_read_real("general", "current_level", 0) // default: 0-th level diff --git a/RandomForest/scripts/funSaveGameState/funSaveGameState.gml b/RandomForest/scripts/funSaveGameState/funSaveGameState.gml index ad2d29a..c093c62 100644 --- a/RandomForest/scripts/funSaveGameState/funSaveGameState.gml +++ b/RandomForest/scripts/funSaveGameState/funSaveGameState.gml @@ -1,6 +1,11 @@ function funSaveGameState() { ini_open("save.ini") + // fullscreen mode + if (global.is_fullscreen != undefined) { + ini_write_real("general", "is_fullscreen", global.is_fullscreen) + } + // current level number if (global.current_level != undefined) { ini_write_real("general", "current_level", global.current_level) diff --git a/RandomForest/scripts/scriptResetStorage/scriptResetStorage.gml b/RandomForest/scripts/scriptResetStorage/scriptResetStorage.gml index 1ea3a22..d08f0d8 100644 --- a/RandomForest/scripts/scriptResetStorage/scriptResetStorage.gml +++ b/RandomForest/scripts/scriptResetStorage/scriptResetStorage.gml @@ -1,6 +1,7 @@ // debug functions function funResetGeneral() { + global.is_fullscreen = false global.current_level = 0 global.is_training_completed = false global.is_game_finished = false From 60124e4d003929901ff1cea9ad3f5dd763d58000 Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sat, 4 Dec 2021 23:42:53 +0300 Subject: [PATCH 04/13] add fullscreen text to training --- RandomForest/RandomForest.yyp | 1 + RandomForest/objects/oTraining/Create_0.gml | 3 +- RandomForest/objects/oTraining/Draw_0.gml | 10 +++ .../88eda8fc-f56a-4f52-aefd-c90e8eb283b6.png | Bin 0 -> 138 bytes .../53230b33-e1a0-498d-b20a-44583abfcd5e.png | Bin 0 -> 138 bytes RandomForest/sprites/sKeyF/sKeyF.yy | 79 ++++++++++++++++++ 6 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 RandomForest/sprites/sKeyF/88eda8fc-f56a-4f52-aefd-c90e8eb283b6.png create mode 100644 RandomForest/sprites/sKeyF/layers/88eda8fc-f56a-4f52-aefd-c90e8eb283b6/53230b33-e1a0-498d-b20a-44583abfcd5e.png create mode 100644 RandomForest/sprites/sKeyF/sKeyF.yy diff --git a/RandomForest/RandomForest.yyp b/RandomForest/RandomForest.yyp index d5fed8a..15e0592 100644 --- a/RandomForest/RandomForest.yyp +++ b/RandomForest/RandomForest.yyp @@ -133,6 +133,7 @@ {"id":{"name":"scriptPlayerHurtState","path":"scripts/scriptPlayerHurtState/scriptPlayerHurtState.yy",},"order":10,}, {"id":{"name":"rTraining","path":"rooms/rTraining/rTraining.yy",},"order":4,}, {"id":{"name":"scriptSlimeHurtState","path":"scripts/scriptSlimeHurtState/scriptSlimeHurtState.yy",},"order":4,}, + {"id":{"name":"sKeyF","path":"sprites/sKeyF/sKeyF.yy",},"order":6,}, {"id":{"name":"scriptPlayerMoveState","path":"scripts/scriptPlayerMoveState/scriptPlayerMoveState.yy",},"order":3,}, {"id":{"name":"sSlimeHurt","path":"sprites/sSlimeHurt/sSlimeHurt.yy",},"order":3,}, {"id":{"name":"sSkeletonMove","path":"sprites/sSkeletonMove/sSkeletonMove.yy",},"order":1,}, diff --git a/RandomForest/objects/oTraining/Create_0.gml b/RandomForest/objects/oTraining/Create_0.gml index 2d84f3f..28f00d5 100644 --- a/RandomForest/objects/oTraining/Create_0.gml +++ b/RandomForest/objects/oTraining/Create_0.gml @@ -6,6 +6,7 @@ self.default_font_20 = font_add("glasstown.ttf", 20, true, false, 32, 128) self.arrow_keys_text = " - Движение персонажа" self.x_key_text = " - Атака / Возврат меча" self.c_key_text = " - Бросок меча / Телепорт" +self.fullscreen_text = " - Полноэкранный режим" self.continue_text = "Для продолжения нажмите любую клавишу" // size constants @@ -20,7 +21,7 @@ self.key_height = self.key_scale * sprite_get_height(sKeyX) self.room_center_x = room_width / 2 self.room_center_y = room_height / 2 self.start_x = self.room_center_x - 130 -self.start_y = self.room_center_y - 70 +self.start_y = self.room_center_y - 85 // alpha settings self.text_alpha = 0.9 diff --git a/RandomForest/objects/oTraining/Draw_0.gml b/RandomForest/objects/oTraining/Draw_0.gml index 8fd26d1..1e54531 100644 --- a/RandomForest/objects/oTraining/Draw_0.gml +++ b/RandomForest/objects/oTraining/Draw_0.gml @@ -28,6 +28,11 @@ var c_key_start_x = x_key_start_x var c_key_start_y = x_key_start_y + (self.key_height + self.key_shift) + self.line_interval draw_sprite_ext(sKeyC, 0, c_key_start_x, c_key_start_y, self.key_scale, self.key_scale, 0, c_white, self.sprite_alpha) +// draw F key (fullscreen) +var f_key_start_x = c_key_start_x +var f_key_start_y = c_key_start_y + (self.key_height + self.key_shift) + self.line_interval +draw_sprite_ext(sKeyF, 0, f_key_start_x, f_key_start_y, self.key_scale, self.key_scale, 0, c_white, self.sprite_alpha) + // set up font for controls draw_set_halign(fa_left) @@ -49,6 +54,11 @@ var c_key_text_x = arrow_keys_text_x var c_key_text_y = c_key_start_y + self.magic_shift draw_text_color(c_key_text_x, c_key_text_y, self.c_key_text, c_white, c_white, c_white, c_white, self.text_alpha) +// type F key text (fullscreen) +var f_key_text_x = arrow_keys_text_x +var f_key_text_y = f_key_start_y + self.magic_shift +draw_text_color(f_key_text_x, f_key_text_y, self.fullscreen_text, c_white, c_white, c_white, c_white, self.text_alpha) + // set up font for continue draw_set_halign(fa_middle) diff --git a/RandomForest/sprites/sKeyF/88eda8fc-f56a-4f52-aefd-c90e8eb283b6.png b/RandomForest/sprites/sKeyF/88eda8fc-f56a-4f52-aefd-c90e8eb283b6.png new file mode 100644 index 0000000000000000000000000000000000000000..0c17f0e49fb45a6c06ee789403603714dfaf9582 GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRQ!3HGLSWET+sX$K`$B>FS$%zb2{~ZoAFdHy2 za(gsx>f+KfO<;~ln6tb5U4lkKX4*lu4!!^p#o29Z8cQY@Fz!&Qu}ksv(K+(USc2i? lW}OIwM!^%uBxfj8GWhq%X8x;YSpqbi!PC{xWt~$(69C9;DbWA` literal 0 HcmV?d00001 diff --git a/RandomForest/sprites/sKeyF/layers/88eda8fc-f56a-4f52-aefd-c90e8eb283b6/53230b33-e1a0-498d-b20a-44583abfcd5e.png b/RandomForest/sprites/sKeyF/layers/88eda8fc-f56a-4f52-aefd-c90e8eb283b6/53230b33-e1a0-498d-b20a-44583abfcd5e.png new file mode 100644 index 0000000000000000000000000000000000000000..0c17f0e49fb45a6c06ee789403603714dfaf9582 GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRQ!3HGLSWET+sX$K`$B>FS$%zb2{~ZoAFdHy2 za(gsx>f+KfO<;~ln6tb5U4lkKX4*lu4!!^p#o29Z8cQY@Fz!&Qu}ksv(K+(USc2i? lW}OIwM!^%uBxfj8GWhq%X8x;YSpqbi!PC{xWt~$(69C9;DbWA` literal 0 HcmV?d00001 diff --git a/RandomForest/sprites/sKeyF/sKeyF.yy b/RandomForest/sprites/sKeyF/sKeyF.yy new file mode 100644 index 0000000..38fd336 --- /dev/null +++ b/RandomForest/sprites/sKeyF/sKeyF.yy @@ -0,0 +1,79 @@ +{ + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 2.525, + "bbox_left": 0, + "bbox_right": 8, + "bbox_top": 0, + "bbox_bottom": 9, + "HTile": false, + "VTile": false, + "For3D": false, + "width": 9, + "height": 10, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"compositeImage":{"FrameId":{"name":"88eda8fc-f56a-4f52-aefd-c90e8eb283b6","path":"sprites/sKeyF/sKeyF.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"88eda8fc-f56a-4f52-aefd-c90e8eb283b6","path":"sprites/sKeyF/sKeyF.yy",},"LayerId":{"name":"53230b33-e1a0-498d-b20a-44583abfcd5e","path":"sprites/sKeyF/sKeyF.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"sKeyF","path":"sprites/sKeyF/sKeyF.yy",},"resourceVersion":"1.0","name":"88eda8fc-f56a-4f52-aefd-c90e8eb283b6","tags":[],"resourceType":"GMSpriteFrame",}, + ], + "sequence": { + "spriteId": {"name":"sKeyF","path":"sprites/sKeyF/sKeyF.yy",}, + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"87da75dd-2971-4167-9a68-ca5a254bf51d","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"88eda8fc-f56a-4f52-aefd-c90e8eb283b6","path":"sprites/sKeyF/sKeyF.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"sKeyF","path":"sprites/sKeyF/sKeyF.yy",}, + "resourceVersion": "1.3", + "name": "sKeyF", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"53230b33-e1a0-498d-b20a-44583abfcd5e","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "Keyboard", + "path": "folders/Sprites/UI/Keyboard.yy", + }, + "resourceVersion": "1.0", + "name": "sKeyF", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file From 7ccb2869e77098d93cb3f280243ed01f40e68810 Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sat, 4 Dec 2021 23:46:20 +0300 Subject: [PATCH 05/13] add secret timer disabling --- RandomForest/objects/oTimeCounter/Create_0.gml | 5 ++++- RandomForest/objects/oTimeCounter/Draw_0.gml | 4 ++++ RandomForest/objects/oTimeCounter/Step_0.gml | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/RandomForest/objects/oTimeCounter/Create_0.gml b/RandomForest/objects/oTimeCounter/Create_0.gml index e712991..3bc880b 100644 --- a/RandomForest/objects/oTimeCounter/Create_0.gml +++ b/RandomForest/objects/oTimeCounter/Create_0.gml @@ -5,4 +5,7 @@ self.default_font = font_add("glasstown.ttf", 12, true, false, 32, 128) self.may_count = false // time -self.time_counter = 0 \ No newline at end of file +self.time_counter = 0 + +// secret opportunity +self.timer_drawing_enabled = true \ No newline at end of file diff --git a/RandomForest/objects/oTimeCounter/Draw_0.gml b/RandomForest/objects/oTimeCounter/Draw_0.gml index 449a9c0..cfd930d 100644 --- a/RandomForest/objects/oTimeCounter/Draw_0.gml +++ b/RandomForest/objects/oTimeCounter/Draw_0.gml @@ -1,3 +1,7 @@ +if (not self.timer_drawing_enabled) { + return +} + // set position on the screen self.x = 480 - 12 - 20 // magic self.y = 10 diff --git a/RandomForest/objects/oTimeCounter/Step_0.gml b/RandomForest/objects/oTimeCounter/Step_0.gml index 17ae532..b5b01c2 100644 --- a/RandomForest/objects/oTimeCounter/Step_0.gml +++ b/RandomForest/objects/oTimeCounter/Step_0.gml @@ -2,6 +2,10 @@ if (keyboard_check_pressed(vk_anykey)) { self.may_count = true // timer starts after any player response } +if (keyboard_check_pressed(ord("T"))) { + self.timer_drawing_enabled = !self.timer_drawing_enabled +} + if (self.may_count) { self.time_counter += 1 } \ No newline at end of file From 41889b7ae19e5aae8488a4306ade9a12e92f24fe Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sat, 4 Dec 2021 23:59:00 +0300 Subject: [PATCH 06/13] add fullscreen to debug output --- RandomForest/objects/oDebug/Step_0.gml | 5 ++++- RandomForest/objects/oLoading/Create_0.gml | 3 +++ RandomForest/objects/oPauseMenu/Draw_0.gml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RandomForest/objects/oDebug/Step_0.gml b/RandomForest/objects/oDebug/Step_0.gml index 7ebd112..022e6b1 100644 --- a/RandomForest/objects/oDebug/Step_0.gml +++ b/RandomForest/objects/oDebug/Step_0.gml @@ -12,11 +12,12 @@ if (self.debug_current_index > string_length(self.debug_password)) { } -// if prod +// if production if (!global.is_debug) { return } +// settings if (keyboard_check_pressed(ord("R"))) { // reset saved level number funResetGeneral() } @@ -34,7 +35,9 @@ if (keyboard_check_pressed(ord("Q"))) { // auto collect all coins instance_destroy(oCoin) } +// messages if (self.frame_counter % 60 == 0) { + show_debug_message("is_fullscreen: " + string(global.is_fullscreen)) show_debug_message("current_level: " + string(global.current_level)) show_debug_message("is_game_finished: " + string(global.is_game_finished)) show_debug_message("is_training_completed: " + string(global.is_training_completed)) diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index 0238486..acf08f0 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -1,9 +1,12 @@ /// @description Initializing the game // Load saved state + funLoadGameState() + //Game window resizing + window_set_fullscreen(global.is_fullscreen) global.scale = 3 diff --git a/RandomForest/objects/oPauseMenu/Draw_0.gml b/RandomForest/objects/oPauseMenu/Draw_0.gml index 73a1174..1a9320d 100644 --- a/RandomForest/objects/oPauseMenu/Draw_0.gml +++ b/RandomForest/objects/oPauseMenu/Draw_0.gml @@ -1,6 +1,6 @@ if (self.paused) { gpu_set_tex_filter(true) - + var cam = view_camera[0] draw_sprite(self.screenshot, 0, camera_get_view_x(cam), From cbaf2dd8085d9355e60f25c0865a579896ea436a Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sun, 5 Dec 2021 00:31:45 +0300 Subject: [PATCH 07/13] fix not fullscreen size & window position --- RandomForest/RandomForest.yyp | 1 + RandomForest/objects/oFullscreen/Create_0.gml | 4 +++ RandomForest/objects/oFullscreen/Step_0.gml | 14 ++++++++- .../objects/oFullscreen/oFullscreen.yy | 1 + RandomForest/objects/oLoading/Alarm_0.gml | 1 + RandomForest/objects/oLoading/Create_0.gml | 25 +-------------- .../funUpdateFullscreen.gml | 31 +++++++++++++++++++ .../funUpdateFullscreen.yy | 12 +++++++ 8 files changed, 64 insertions(+), 25 deletions(-) create mode 100644 RandomForest/objects/oFullscreen/Create_0.gml create mode 100644 RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml create mode 100644 RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.yy diff --git a/RandomForest/RandomForest.yyp b/RandomForest/RandomForest.yyp index 15e0592..e91b0f7 100644 --- a/RandomForest/RandomForest.yyp +++ b/RandomForest/RandomForest.yyp @@ -136,6 +136,7 @@ {"id":{"name":"sKeyF","path":"sprites/sKeyF/sKeyF.yy",},"order":6,}, {"id":{"name":"scriptPlayerMoveState","path":"scripts/scriptPlayerMoveState/scriptPlayerMoveState.yy",},"order":3,}, {"id":{"name":"sSlimeHurt","path":"sprites/sSlimeHurt/sSlimeHurt.yy",},"order":3,}, + {"id":{"name":"funUpdateFullscreen","path":"scripts/funUpdateFullscreen/funUpdateFullscreen.yy",},"order":2,}, {"id":{"name":"sSkeletonMove","path":"sprites/sSkeletonMove/sSkeletonMove.yy",},"order":1,}, {"id":{"name":"sBungaloSword","path":"sprites/sBungaloSword/sBungaloSword.yy",},"order":7,}, {"id":{"name":"sKeyArrowLeft","path":"sprites/sKeyArrowLeft/sKeyArrowLeft.yy",},"order":2,}, diff --git a/RandomForest/objects/oFullscreen/Create_0.gml b/RandomForest/objects/oFullscreen/Create_0.gml new file mode 100644 index 0000000..d18347e --- /dev/null +++ b/RandomForest/objects/oFullscreen/Create_0.gml @@ -0,0 +1,4 @@ +// custom alarm[0] mechanism doesn't work because of $#*@%!!! +// so: +self.alarm_counter_max = 10 // frames = attempts +self.alarm_counter = 0 \ No newline at end of file diff --git a/RandomForest/objects/oFullscreen/Step_0.gml b/RandomForest/objects/oFullscreen/Step_0.gml index fb04cf2..bcd1194 100644 --- a/RandomForest/objects/oFullscreen/Step_0.gml +++ b/RandomForest/objects/oFullscreen/Step_0.gml @@ -1,5 +1,17 @@ +// switch mode if (keyboard_check_pressed(global.key_fullscreen)) { global.is_fullscreen = !global.is_fullscreen funSaveGameState() - window_set_fullscreen(global.is_fullscreen) +} + +// update state (+ for external changes) +if (window_get_fullscreen() != global.is_fullscreen) { + funUpdateFullscreen() + self.alarm_counter = self.alarm_counter_max // for centering +} + +// beg the window to center (please...) +if (self.alarm_counter != 0) { + self.alarm_counter -= 1 + window_center() } \ No newline at end of file diff --git a/RandomForest/objects/oFullscreen/oFullscreen.yy b/RandomForest/objects/oFullscreen/oFullscreen.yy index 194b0ea..3c644d5 100644 --- a/RandomForest/objects/oFullscreen/oFullscreen.yy +++ b/RandomForest/objects/oFullscreen/oFullscreen.yy @@ -19,6 +19,7 @@ "physicsShapePoints": [], "eventList": [ {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, ], "properties": [], "overriddenProperties": [], diff --git a/RandomForest/objects/oLoading/Alarm_0.gml b/RandomForest/objects/oLoading/Alarm_0.gml index 80d5352..4eb41eb 100644 --- a/RandomForest/objects/oLoading/Alarm_0.gml +++ b/RandomForest/objects/oLoading/Alarm_0.gml @@ -1,6 +1,7 @@ /// @description Go to next level window_center() +alarm[0] = false // go to next room if (global.is_training_completed) { diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index acf08f0..b1f4bb1 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -7,31 +7,8 @@ funLoadGameState() //Game window resizing -window_set_fullscreen(global.is_fullscreen) - global.scale = 3 -var cam = room_get_camera(rLevel00, 0) -var cam_width = camera_get_view_width(cam) -var cam_height = camera_get_view_height(cam) -var window_width_scaled = cam_width * global.scale -var window_height_scaled = cam_height * global.scale - -var viewport = room_get_viewport(rLevel00, 0) - -for (var i = 0; i < room_last; i++) { - if (i == rLoading) { - continue - } - - room_set_viewport(i, 0, - viewport[0], viewport[1], viewport[2], - window_width_scaled, window_height_scaled - ) -} - -surface_resize(application_surface, cam_width, cam_height) - -window_set_size(window_width_scaled, window_height_scaled) +funUpdateFullscreen() alarm[0] = true // for centering display_set_gui_maximize(global.scale, global.scale, 0, 0) diff --git a/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml b/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml new file mode 100644 index 0000000..8087737 --- /dev/null +++ b/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml @@ -0,0 +1,31 @@ +function funUpdateFullscreen() { + if (global.is_fullscreen) { + window_set_fullscreen(true) + } + else { + window_set_fullscreen(false) + + var cam = room_get_camera(rLevel00, 0) + var cam_width = camera_get_view_width(cam) + var cam_height = camera_get_view_height(cam) + var window_width_scaled = cam_width * global.scale + var window_height_scaled = cam_height * global.scale + + var viewport = room_get_viewport(rLevel00, 0) + + for (var i = 0; i < room_last; i++) { + if (i == rLoading) { + continue + } + + room_set_viewport(i, 0, + viewport[0], viewport[1], viewport[2], + window_width_scaled, window_height_scaled + ) + } + + surface_resize(application_surface, cam_width, cam_height) + + window_set_size(window_width_scaled, window_height_scaled) + } +} \ No newline at end of file diff --git a/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.yy b/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.yy new file mode 100644 index 0000000..9e26067 --- /dev/null +++ b/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "UI", + "path": "folders/Scripts/UI.yy", + }, + "resourceVersion": "1.0", + "name": "funUpdateFullscreen", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file From 88a5db179c815f8f786a44fe29ee21d95f22f448 Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sun, 5 Dec 2021 00:40:23 +0300 Subject: [PATCH 08/13] enable fullscreen controller on pause --- RandomForest/objects/oPauseMenu/Step_0.gml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/RandomForest/objects/oPauseMenu/Step_0.gml b/RandomForest/objects/oPauseMenu/Step_0.gml index db75f1a..ec487a6 100644 --- a/RandomForest/objects/oPauseMenu/Step_0.gml +++ b/RandomForest/objects/oPauseMenu/Step_0.gml @@ -14,23 +14,29 @@ if (keyboard_check_pressed(global.key_pause)) { if (self.paused) { instance_deactivate_all(true) - + instance_activate_object(oFullscreen) + if (keyboard_check_pressed(vk_enter)) { if (self.current_index == 0) { self.paused = false - } else if (self.current_index == 1) { + } + else if (self.current_index == 1) { room_restart() - } else if (self.current_index == 2) { + } + else if (self.current_index == 2) { game_end() } - } else if (keyboard_check_pressed(vk_down)) { + } + else if (keyboard_check_pressed(vk_down)) { self.current_index += 1 self.current_index %= self.items_count - } else if (keyboard_check_pressed(vk_up)) { + } + else if (keyboard_check_pressed(vk_up)) { self.current_index += (self.items_count - 1) self.current_index %= self.items_count } -} else { +} +else { shader_reset() if (sprite_exists(self.screenshot)) { sprite_delete(self.screenshot) From ee2fe4675461568e4c135c835d2230e992a4eeed Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sun, 5 Dec 2021 00:47:15 +0300 Subject: [PATCH 09/13] fix pause menu on fullscreen --- RandomForest/objects/oLoading/Create_0.gml | 2 +- RandomForest/objects/oPauseMenu/Draw_0.gml | 49 +++++++++++++++++++++ RandomForest/objects/oPauseMenu/Draw_64.gml | 4 ++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index b1f4bb1..1c8480c 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -10,7 +10,7 @@ funLoadGameState() global.scale = 3 funUpdateFullscreen() alarm[0] = true // for centering -display_set_gui_maximize(global.scale, global.scale, 0, 0) +// display_set_gui_maximize(global.scale, global.scale, 0, 0) - no Draw GUI calls now // Temporary config diff --git a/RandomForest/objects/oPauseMenu/Draw_0.gml b/RandomForest/objects/oPauseMenu/Draw_0.gml index 1a9320d..676a693 100644 --- a/RandomForest/objects/oPauseMenu/Draw_0.gml +++ b/RandomForest/objects/oPauseMenu/Draw_0.gml @@ -7,3 +7,52 @@ if (self.paused) { camera_get_view_y(cam) ) } + + +// copied from Draw GUI <<< + +draw_set_halign(fa_center) +draw_set_valign(fa_middle) +draw_set_font(self.default_font) + +if (self.paused) { + + gpu_set_tex_filter(false) + for (var i = 0; i < self.items_count; i++) { + var button_color = c_white + var ui_scale = 1 + if (i == self.current_index) { + draw_set_color(self.current_color) + button_color = self.current_button_color + ui_scale = self.current_scale + } + else { + draw_set_color(self.default_color) + button_color = self.default_button_color + ui_scale = self.default_scale + } + var cam = view_camera[0] + var x_pos = camera_get_view_width(cam) * 0.5 + var y_pos = camera_get_view_height(cam) * (self.top_item + self.separate_dist * i) + + // shift to right position on the screen + x_pos += camera_get_view_x(cam) + y_pos += camera_get_view_y(cam) + + draw_sprite_stretched_ext( + self.border_sprite, 0, + x_pos, y_pos + 1.5, + self.border_width * ui_scale, self.border_height * ui_scale, + button_color, 1 + ) + + draw_text_transformed( + x_pos, y_pos, + self.strings[i], + ui_scale, ui_scale, 0 + ) + } +} + +// reset color +draw_set_color(c_white) diff --git a/RandomForest/objects/oPauseMenu/Draw_64.gml b/RandomForest/objects/oPauseMenu/Draw_64.gml index b44888c..2ad3323 100644 --- a/RandomForest/objects/oPauseMenu/Draw_64.gml +++ b/RandomForest/objects/oPauseMenu/Draw_64.gml @@ -1,3 +1,6 @@ +// moved to Draw >>> + +/* draw_set_halign(fa_center) draw_set_valign(fa_middle) draw_set_font(self.default_font) @@ -38,3 +41,4 @@ if (self.paused) { // reset color draw_set_color(c_white) +*/ \ No newline at end of file From 87991db1afe02da90628210b0a642235228f0d10 Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sun, 5 Dec 2021 00:48:02 +0300 Subject: [PATCH 10/13] enable debug controller on pause --- RandomForest/objects/oPauseMenu/Step_0.gml | 1 + 1 file changed, 1 insertion(+) diff --git a/RandomForest/objects/oPauseMenu/Step_0.gml b/RandomForest/objects/oPauseMenu/Step_0.gml index ec487a6..f367ae3 100644 --- a/RandomForest/objects/oPauseMenu/Step_0.gml +++ b/RandomForest/objects/oPauseMenu/Step_0.gml @@ -14,6 +14,7 @@ if (keyboard_check_pressed(global.key_pause)) { if (self.paused) { instance_deactivate_all(true) + instance_activate_object(oDebug) instance_activate_object(oFullscreen) if (keyboard_check_pressed(vk_enter)) { From 4432f94efcb1f3ac6a69ddd9b5336c172100cbbc Mon Sep 17 00:00:00 2001 From: IdeaSeeker Date: Sun, 5 Dec 2021 00:52:31 +0300 Subject: [PATCH 11/13] fix debug coin collecting --- RandomForest/objects/oDebug/Step_0.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RandomForest/objects/oDebug/Step_0.gml b/RandomForest/objects/oDebug/Step_0.gml index 022e6b1..ea07868 100644 --- a/RandomForest/objects/oDebug/Step_0.gml +++ b/RandomForest/objects/oDebug/Step_0.gml @@ -31,7 +31,7 @@ if (keyboard_check_pressed(ord("P"))) { // to previous level room_goto_previous() } if (keyboard_check_pressed(ord("Q"))) { // auto collect all coins - oCoinCollector.coins_collected = instance_number(oCoin) + oCoinCollector.coins_collected += instance_number(oCoin) instance_destroy(oCoin) } From 89dcc00db77dde7c2f66241a1a9840918c39bc33 Mon Sep 17 00:00:00 2001 From: Rustam Sadykov Date: Sun, 5 Dec 2021 12:25:21 +0300 Subject: [PATCH 12/13] add debug mode saving --- RandomForest/objects/oDebug/Step_0.gml | 1 + RandomForest/objects/oLoading/Create_0.gml | 4 +--- RandomForest/scripts/funLoadGameState/funLoadGameState.gml | 3 +++ RandomForest/scripts/funSaveGameState/funSaveGameState.gml | 5 +++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RandomForest/objects/oDebug/Step_0.gml b/RandomForest/objects/oDebug/Step_0.gml index ea07868..276fa9f 100644 --- a/RandomForest/objects/oDebug/Step_0.gml +++ b/RandomForest/objects/oDebug/Step_0.gml @@ -9,6 +9,7 @@ if (self.debug_current_index > string_length(self.debug_password)) { global.is_debug = !global.is_debug self.debug_current_index = 1 audio_play_sound(soundCoinCollecting, 0, false) // just because + funSaveGameState() } diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index 1c8480c..369ab98 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -28,6 +28,4 @@ global.key_arrow_up = vk_up global.key_arrow_down = vk_down global.key_pause = vk_escape -global.key_fullscreen = ord("F") - -global.is_debug = false // prod by default +global.key_fullscreen = ord("F") \ No newline at end of file diff --git a/RandomForest/scripts/funLoadGameState/funLoadGameState.gml b/RandomForest/scripts/funLoadGameState/funLoadGameState.gml index 963e48d..eb7caf2 100644 --- a/RandomForest/scripts/funLoadGameState/funLoadGameState.gml +++ b/RandomForest/scripts/funLoadGameState/funLoadGameState.gml @@ -1,6 +1,9 @@ function funLoadGameState() { ini_open("save.ini") + // debug mode + global.is_debug = ini_read_real("general", "is_debug", 0) // default: false + // fullscreen mode global.is_fullscreen = ini_read_real("general", "is_fullscreen", 0) // default: false diff --git a/RandomForest/scripts/funSaveGameState/funSaveGameState.gml b/RandomForest/scripts/funSaveGameState/funSaveGameState.gml index c093c62..b3072d1 100644 --- a/RandomForest/scripts/funSaveGameState/funSaveGameState.gml +++ b/RandomForest/scripts/funSaveGameState/funSaveGameState.gml @@ -1,6 +1,11 @@ function funSaveGameState() { ini_open("save.ini") + // debug mode + if (global.is_debug != undefined) { + ini_write_real("general", "is_debug", global.is_debug) + } + // fullscreen mode if (global.is_fullscreen != undefined) { ini_write_real("general", "is_fullscreen", global.is_fullscreen) From dc917e49ad39500f81b199dc84e45cf2302ed0b9 Mon Sep 17 00:00:00 2001 From: Rustam Sadykov Date: Sun, 5 Dec 2021 17:23:20 +0300 Subject: [PATCH 13/13] move gui --- RandomForest/objects/oLoading/Create_0.gml | 23 ++++++++- RandomForest/objects/oPauseMenu/Draw_0.gml | 51 +------------------ RandomForest/objects/oPauseMenu/Draw_64.gml | 4 -- .../funUpdateFullscreen.gml | 9 ++-- 4 files changed, 25 insertions(+), 62 deletions(-) diff --git a/RandomForest/objects/oLoading/Create_0.gml b/RandomForest/objects/oLoading/Create_0.gml index 369ab98..fe09dad 100644 --- a/RandomForest/objects/oLoading/Create_0.gml +++ b/RandomForest/objects/oLoading/Create_0.gml @@ -8,10 +8,29 @@ funLoadGameState() //Game window resizing global.scale = 3 + +var cam = room_get_camera(rLevel00, 0) +var cam_width = camera_get_view_width(cam) +var cam_height = camera_get_view_height(cam) +var window_width_scaled = cam_width * global.scale +var window_height_scaled = cam_height * global.scale + + +for (var i = room_first; i != -1; i = room_next(i)) { + var viewport = room_get_viewport(i, 0) + room_set_camera(i, 0, cam) + room_set_viewport(i, 0, + viewport[0], viewport[1], viewport[2], + window_width_scaled, window_height_scaled + ) +} + +surface_resize(application_surface, cam_width, cam_height) + +window_set_size(window_width_scaled, window_height_scaled) + funUpdateFullscreen() alarm[0] = true // for centering -// display_set_gui_maximize(global.scale, global.scale, 0, 0) - no Draw GUI calls now - // Temporary config diff --git a/RandomForest/objects/oPauseMenu/Draw_0.gml b/RandomForest/objects/oPauseMenu/Draw_0.gml index 676a693..0ddb8b4 100644 --- a/RandomForest/objects/oPauseMenu/Draw_0.gml +++ b/RandomForest/objects/oPauseMenu/Draw_0.gml @@ -6,53 +6,4 @@ if (self.paused) { camera_get_view_x(cam), camera_get_view_y(cam) ) -} - - -// copied from Draw GUI <<< - -draw_set_halign(fa_center) -draw_set_valign(fa_middle) -draw_set_font(self.default_font) - -if (self.paused) { - - gpu_set_tex_filter(false) - for (var i = 0; i < self.items_count; i++) { - var button_color = c_white - var ui_scale = 1 - if (i == self.current_index) { - draw_set_color(self.current_color) - button_color = self.current_button_color - ui_scale = self.current_scale - } - else { - draw_set_color(self.default_color) - button_color = self.default_button_color - ui_scale = self.default_scale - } - var cam = view_camera[0] - var x_pos = camera_get_view_width(cam) * 0.5 - var y_pos = camera_get_view_height(cam) * (self.top_item + self.separate_dist * i) - - // shift to right position on the screen - x_pos += camera_get_view_x(cam) - y_pos += camera_get_view_y(cam) - - draw_sprite_stretched_ext( - self.border_sprite, 0, - x_pos, y_pos + 1.5, - self.border_width * ui_scale, self.border_height * ui_scale, - button_color, 1 - ) - - draw_text_transformed( - x_pos, y_pos, - self.strings[i], - ui_scale, ui_scale, 0 - ) - } -} - -// reset color -draw_set_color(c_white) +} \ No newline at end of file diff --git a/RandomForest/objects/oPauseMenu/Draw_64.gml b/RandomForest/objects/oPauseMenu/Draw_64.gml index 2ad3323..b44888c 100644 --- a/RandomForest/objects/oPauseMenu/Draw_64.gml +++ b/RandomForest/objects/oPauseMenu/Draw_64.gml @@ -1,6 +1,3 @@ -// moved to Draw >>> - -/* draw_set_halign(fa_center) draw_set_valign(fa_middle) draw_set_font(self.default_font) @@ -41,4 +38,3 @@ if (self.paused) { // reset color draw_set_color(c_white) -*/ \ No newline at end of file diff --git a/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml b/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml index 8087737..d63b678 100644 --- a/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml +++ b/RandomForest/scripts/funUpdateFullscreen/funUpdateFullscreen.gml @@ -11,13 +11,10 @@ function funUpdateFullscreen() { var window_width_scaled = cam_width * global.scale var window_height_scaled = cam_height * global.scale - var viewport = room_get_viewport(rLevel00, 0) - - for (var i = 0; i < room_last; i++) { - if (i == rLoading) { - continue - } + for (var i = room_first; i != -1; i = room_next(i)) { + var viewport = room_get_viewport(i, 0) + room_set_camera(i, 0, cam) room_set_viewport(i, 0, viewport[0], viewport[1], viewport[2], window_width_scaled, window_height_scaled