I write a Mosaic game, need some help

chengjunzh

Member
Licensed User
i write the game, and it can be run ok, but, i cost too many memory and the images in some form is not well shown, can somebody give me any help? :sign0085:
you can download .exe file from ??_Mobile Games_????.
 

Attachments

  • Mosaic1.3.zip
    70.1 KB · Views: 212

Cableguy

Expert
Licensed User
Longtime User
At first glance A LOT of code optimization can be done.
You use too many code lines in repeting jobs lie assigning a value to an array.
ie, this code :

B4X:
FileWrite (c1,store(0))
         FileWrite (c1,store(1))
         FileWrite (c1,store(2))
         FileWrite (c1,store(3))
         FileWrite (c1,store(4))
         FileWrite (c1,store(5))
         FileWrite (c1,store(6))
         FileWrite (c1,store(7))
         FileWrite (c1,store(8))
         FileWrite (c1,store(9))
         FileWrite (c1,store(10))
         FileWrite (c1,store(11))
         FileWrite (c1,store(12))
         FileWrite (c1,store(13))
         FileWrite (c1,store(14))
         FileWrite (c1,store(15)

CAN BE REPLACED BY:

B4X:
FOR A = 1 TO 15
FileWrite (c1,store(A))
NEXT

You can also reduce dramatically the size of your app by assigning a single sub to all image clicks and using the sender keyword to find wich was clicked.

If you post a more complete zip file with all needed filles to run the app, a more hands on help can be given.
 
Top