B4X FEED Tick-Tack-Toe: working with arrays of views

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: Tick-Tack-Toe: working with arrays of views است. این موضوع تا کنون 48 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Tick-Tack-Toe: working with arrays of views
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
48
پسندها
0
آخرین ارسال توسط PracticalSoft
وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.
Jun 6, 2020
11,517
4,383
This is an example of a Tick-Tack-Toe game.
This game demonstrates two concepts. The first is an example of working with multiple views without duplicating code. In this case it is 9 buttons, however similar code can easily handle any number of views.
The second concept is the handling of Activity_Pause and Activity_Resume events to keep the game state during the activity life cycle.

The test it you just need to rotate the device. During the orientation change the activity is paused, created again and eventually resumed.
The game should continue from the previous state.

برای دیدن تصاویر باید ثبت نام کنید



The following code creates the 9 buttons, puts each button in the correct place and stores a reference to this button in the Buttons array (two dimensions array):
B4X:

کد:
محتوای بلوک کدها در دسترس شما نیست. برای مشاهده بلوک کدها، وارد انجمن شوید یاثبت نام کنید


 

وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.
عقب
بالا