Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Blink's Beginners Caveats

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2015 04:42 Edited at: 11th Jan 2016 23:02
These are the things i've found as i have ported a basic game to AppGameKit (PC & Android)

1) Android file names are case sensitive

2) GetFirstFolder()/GetNextFolder() Do NOT work on android.

3) To publish on google play you need a keystore. You can generate one here https://developer.thegamecreators.com/android/create_keystore.php or through the AppGameKit IDE Tools/Android/Generate Keystore file

4) When exporting an .APK file the Package name should be in the format com.company.product

5) Excellent example of a texture atlas here https://forum.thegamecreators.com/thread/216038

6) Arrays are defined and .length is set/reported one less than the physical length. So the value specified in Dim and returned by length is actually the last element from zero, not the physical count

As i find/remember other things i'll add them here. If anyone else finds something that has cost them time in the beginning feel free to add it here

Sign up for NaGaCreMo!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Dec 2015 08:38
Quote: "2) GetFirstFolder()/GetNextFolder() Do NOT work on android.

3) SetFolder(/media")/GetFirstFile()/GetNextFile() Do work on android"


They work here for me. I just compiled and ran a program of mine in 2.0.15d, here is the snippet...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Dec 2015 08:48 Edited at: 17th Dec 2015 08:53
Quote: "6) The .sort() method for arrays does NOT include element 0 (ie. array[0] is not included in the sort)"


Sorting arrays does include element 0, try this code:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2015 19:15 Edited at: 17th Dec 2015 19:16
maybe it's just string array's then
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2015 19:38
I just tried this on my samsung galaxy tablet and it didn't work. the IDE reports version (Built on Geany 1.24.1). My product download link said 2.0.16

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Dec 2015 19:45
I have highlighted the errors with "XXX" and replaced the code.

The basic error is that an array[7] has 8 elements (0 - 7)
You haven't added a value to the last element, but have not printed it either so you can't see the mistake
Then you sort and the blank element shuffles to the top
Then you print again with the empty element at the top, and the last element omitted from the print (8)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2015 20:02 Edited at: 17th Dec 2015 20:09
oh i see. how stoopid of me. thank you for your help

so the dim[value] and .length set/return one less than are in the array is that right?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Dec 2015 20:55
[value] and length are the index of the last element. But because element 0 exists, the real length is one more.

Unless I really need it, I ignore element zero and work from element 1. It is much easier to avoid errors this way.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2015 21:01
yeah i see it now. it was even covered in the doco. i should have read more carefully. i see how it fits in the language better too

Login to post a reply

Server time is: 2024-11-21 15:13:38
Your offset time is: 2024-11-21 15:13:38