salmana

سورس ساده ذخیره کردن بازی بعد از خروج

1 ارسال در این موضوع قرار دارد

یکی از دوستان ذخیره بازی میخاستن و منم یک سورس ساده نوشتم و گذاشتم اینجا و گفتم شاید به درد کسی خورد

 

لینک دانلود سورس

 

کدهاش :

Sub Globals
Private EditText1 As EditText
Private Button1 As Button
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
If	File.Exists(File.DirInternal,"1.txt")=False Then
Label1.Text="1+1=؟"
Else
Label1.Text=File.ReadString	(File.DirInternal,"1.txt")
End If
End Sub
Sub Button1_Click
If Label1.Text="1+1=؟" And EditText1.Text=2 Then
Label1.Text="1+2=؟"	
File.WriteString(File.DirInternal,"1.txt",Label1.Text)
End If

If Label1.Text="1+2=؟"	 And EditText1.Text=3 Then
Label1.Text="1+3=؟"	
File.WriteString(File.DirInternal,"1.txt",Label1.Text)
End If

If Label1.Text="1+3=؟"	 And EditText1.Text=4 Then
Label1.Text="1+4=؟"	
File.WriteString(File.DirInternal,"1.txt",Label1.Text)
End If	
End Sub



nasim و H@mid.RS پسند شده است

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

  • مطالب مشابه

    • توسط nasim
      سلام به همه ی کاربرای انجمن
      سورسی که امروز براتون در نظر گرفتیم ساخت تنظیمات با دیتابیسه که بهترین حالت برای ساخت تنظیمات هستش
      تو بیشتر مواقع تنظیمات رو تو فایل تکست ذخیره میکنن که مشکلای خاص خودش رو داره ولی با دیتابیس کار شما خیلی راحتتر و اصولی میشه
      یه اسکرین از سورس هم میذارم براتون دیگه گرافیک کار با خودتون
      هر مشکلی بود تو همین تاپیک مطرح کنین


       
      لینک سورس
    • توسط H@mid.RS
      لیست یک سری از اکشین ها برای استفاده در بیسیک۴آندروید
       


      ACCESSIBILITY_SETTINGS = Show settings for accessibility modules.
      ADD_ACCOUNT = Show add account screen for creating a new account.
      AIRPLANE_MODE_SETTINGS = Show settings to allow entering/exiting airplane mode.
      APN_SETTINGS = Show settings to allow configuration of APNs.
      APPLICATION_DETAILS_SETTINGS = Show screen of details about a particular application.
      APPLICATION_DEVELOPMENT_SETTINGS = Show settings to allow configuration of application development-related settings.
      APPLICATION_SETTINGS = Show settings to allow configuration of application-related settings.
      BLUETOOTH_SETTINGS = Show settings to allow configuration of Bluetooth.
      DATA_ROAMING_SETTINGS = Show settings for selection of 2G/3G.
      DATE_SETTINGS = Show settings to allow configuration of date and time.
      DEVICE_INFO_SETTINGS = Show general device information settings (serial number, software version, phone number, etc.).
      DISPLAY_SETTINGS = Show settings to allow configuration of display.
      INPUT_METHOD_SETTINGS = Show settings to configure input methods, in particular allowing the user to enable input methods.
      INPUT_METHOD_SUBTYPE_SETTINGS = Show settings to enable/disable input method subtypes.
      INTERNAL_STORAGE_SETTINGS = Show settings for internal storage.
      LOCALE_SETTINGS = Show settings to allow configuration of locale.
      LOCATION_SOURCE_SETTINGS = Show settings to allow configuration of current location sources.
      MANAGE_ALL_APPLICATIONS_SETTINGS = Show settings to manage all applications.
      MANAGE_APPLICATIONS_SETTINGS = Show settings to manage installed applications.
      MEMORY_CARD_SETTINGS = Show settings for memory card storage.
      NETWORK_OPERATOR_SETTINGS = Show settings for selecting the network operator.
      NFCSHARING_SETTINGS = Show NFC Sharing settings.
      NFC_SETTINGS = Show NFC settings.
      PRIVACY_SETTINGS = Show settings to allow configuration of privacy options.
      QUICK_LAUNCH_SETTINGS = Show settings to allow configuration of quick launch shortcuts.
      SEARCH_SETTINGS = Show settings for global search.
      SECURITY_SETTINGS = Show settings to allow configuration of security and location privacy.
      SETTINGS = Show system settings.
      SOUND_SETTINGS = Show settings to allow configuration of sound and volume.
      SYNC_SETTINGS = Show settings to allow configuration of sync settings.
      USER_DICTIONARY_SETTINGS = Show settings to manage the user input dictionary.
      WIFI_IP_SETTINGS = Show settings to allow configuration of a static IP address for Wi-Fi.
      WIFI_SETTINGS = Show settings to allow configuration of Wi-Fi.
      WIRELESS_SETTINGS = Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.
      EXTRA_AUTHORITIES = Limit available options in launched activity based on the given authority.


      طریقه استفاده از این اکشن ها در لینک زیر :

       

      http://basic4x.ir/topic/128-%D8%B1%D9%81%D8%AA%D9%86-%D8%A8%D9%87-%D9%82%D8%B3%D9%85%D8%AA-wireless-network-%D8%A8%D8%A7-%DA%A9%D8%AF-%D8%AF%D8%B1-%D8%A8%DB%8C%D8%B3%DB%8C%DA%A9-%D9%81%D9%88%D8%B1-%D8%A7%D9%86%D8%AF%D8%B1%D9%88%DB%8C%D8%AF/