[GAME] Polygons

55 views
Skip to first unread message

Symbroson Development

unread,
Oct 2, 2016, 2:23:38 PM10/2/16
to DroidScript
Hi it's me again and I have developed anorher game demo
I tried to comment the code well but if there was other questions/tips/bugs please tell me :)

It is the sort of games where you have to put three objects with the same skin in a row to destroy them (has it a general name like tictactoe or pong has?)

Please test it out and give a report how you find the game (and the animations ;)

Thanks to my friend R. who gave me a hint how to make an interrupted sine-graph

Best regards,
Symbroson

Symbroson Development

unread,
Oct 2, 2016, 3:31:57 PM10/2/16
to DroidScript
1.sry I forgot to attach the spk 😅
2. I've a problem: I made the apk of my game and when I tried to start it it was extreme laggy and the game needed very long to load. Does someone know why that could happen?
The apk was in my dropbox if you want to try it out:
https://www.dropbox.com/sh/s3t4mb4vbyftkvo/AADOKNRudnJ_lD6x6unZuOWva
thanks for help
Polygons.spk

Robbie Kendall

unread,
Oct 2, 2016, 7:09:13 PM10/2/16
to DroidScript
Awesome game alex! Works great for me.

Robbie Kendall

unread,
Oct 2, 2016, 7:19:34 PM10/2/16
to DroidScript
I tried the apk and it gets stuck on the splash screen for me, never loads the game

Symbroson Development

unread,
Oct 3, 2016, 12:38:43 AM10/3/16
to DroidScript
Thats the problem :/

Chris

unread,
Oct 3, 2016, 8:57:30 AM10/3/16
to DroidScript
Are you using a FadeOut on a animate call? I just recently ran in to this problem on 5.1 android devices. The callback never fires.

I didn't look at the code, just know this problem exists.

Manuel Lopes

unread,
Oct 3, 2016, 8:59:43 AM10/3/16
to DroidScript
very cool alex thanks for share

Chris

unread,
Oct 3, 2016, 9:02:40 AM10/3/16
to DroidScript
function hideSplash(){laySplash.Animate("FadeOut",showGame,1000)}

Try:

function hideSplash(){
laySplash.Animate("FadeOut",null,1000);
setTimeout("showGame",1010);
}

It is a hack, but was a work around for my 5.1 droid problems. Seems FadeOut is the only problem, but not for sure.

Symbroson Development

unread,
Oct 3, 2016, 9:05:07 AM10/3/16
to DroidScript
Thank you I'll try it out :)

Chris

unread,
Oct 3, 2016, 9:12:22 AM10/3/16
to DroidScript
Alex, checking my hack, I also had to hide my splash... so...

function hideSplash(){
laySplash.Animate("FadeOut",null,1000);

setTimeout("laySplash.SetVisibility('Hide');showGame",1010);


Chris

Chris

unread,
Oct 3, 2016, 9:14:08 AM10/3/16
to DroidScript
Sorry... why I should always try code, the showGame needs ()

function hideSplash(){
laySplash.Animate("FadeOut",null,1000);

setTimeout("laySplash.SetVisibility('Hide');showGame();",1010);

Chris

unread,
Oct 3, 2016, 9:20:10 AM10/3/16
to DroidScript
Wow. I'm having a difficult morning. Don't forget the final } on the function.

I know you wouldn't but, I hate mistakes. :-)

function hideSplash(){
laySplash.Animate("FadeOut",null,1000);
setTimeout("laySplash.SetVisibility('Hide');showGame();",1010);
}

Chris

Symbroson Development

unread,
Oct 3, 2016, 9:45:48 AM10/3/16
to DroidScript
Think I got it now
In my current spk I changed Steves and your tips and the apk works now - a bit long BUT it loads. And if it has loaded and remove a row you'll see that the app freezes for a short time when it adds a new row on the top.
so the mistake or what causes the long loading time is the 'newRow()' function
It just does that:

function newRow() {
var a=[]
for(var i=0; i<sizX; i++) a.push({"value":ranInt(app.ListFolder("Objects").length),"touched":false,
"rotc":30*Math.random(),"dx":0,"dy":0,"siz":0.9,"die":false,"v":0})
return a
}

Symbroson Development

unread,
Oct 3, 2016, 9:53:49 AM10/3/16
to DroidScript
I added two popups - one before and one after the loop and in the apk it prooves that this loop causes the lags and long loading time. But I dont understand why this loop needs so long?

Symbroson Development

unread,
Oct 3, 2016, 9:58:58 AM10/3/16
to DroidScript
I think listFolder() is the problem...

Symbroson Development

unread,
Oct 3, 2016, 10:04:34 AM10/3/16
to DroidScript
Yes it was. Thanks for your help Steve and Chris - finally I found it ^^
I haven't thaught that listFolder() needs that long...

Symbroson Development

unread,
Oct 3, 2016, 5:51:38 PM10/3/16
to DroidScript
I made a second version of Polygons with a bit different destroying rule: you have to connect more than three objects in a row to destroy them.
So here are the folders with spk and apk of both versions:

Polygons 1 (changing):
https://www.dropbox.com/sh/s3t4mb4vbyftkvo/AADOKNRudnJ_lD6x6unZuOWva

Polygons 2 (connecting):
https://www.dropbox.com/sh/6cz5jpzcih353ej/AACW4dK0S1cPtcZ1SJrs-Qxea

Thank you for testing and reporting them :)
Best regards,
Symbroson

Robbie Kendall

unread,
Oct 3, 2016, 7:54:56 PM10/3/16
to DroidScript
Doesn't have to be more than 3, had to be 3 or more. Also I don't know if you intended but you can also connect with shapes diagonally so it allows connecting of really large numbers of shapes. Will try apk and let you know how it goes.

Symbroson Development

unread,
Oct 4, 2016, 3:22:21 AM10/4/16
to DroidScript
Sorry it was an expression mistake ^^
And yes you can connect diagonal - that was right - no bug ^^

Robbie Kendall

unread,
Oct 4, 2016, 10:02:16 PM10/4/16
to DroidScript
Cool man it definitely makes for some larger breaking. Hadn't tried the apk yet in the new one. Did you ever get it working right on your end?

Ca3m0n 0_0

unread,
Oct 5, 2016, 11:44:53 AM10/5/16
to DroidScript
Hey symbroson, I'm just curious what device you are using to run this application?

Symbroson Development

unread,
Oct 5, 2016, 12:04:45 PM10/5/16
to DroidScript
The working files are those on my DropBox. Heres the link:
https://www.dropbox.com/sh/0i6c7w50elnu1s6/AABo5e4n_EMkmadcg-NAL5S5a

Look at /Games/Polygons or /Games/Polygons 2

Reply all
Reply to author
Forward
0 new messages