Hi,
Tried it on a android tablet and a samsung galaxy. and i see the problem, actually it looks like a physics bug.
Here is a version that works on mobiles and tablets.
rem Preben Eriksen, testing AGK physics.
SetVirtualResolution ( 800 , 480 )
SetOrientationAllowed ( 1, 1, 1, 1 )
centx = GetDeviceWidth ( ) / 2
centy = GetDeviceHeight ( ) / 2
global myspriteindex = 1
global width,height
width = GetDeviceWidth ( )
height = GetDeviceHeight ( )
dim mysprites[ 1000 ]
global startrecord = 0
global maxrecord = 480
global recordindex = 0
dim recordxy[ (maxrecord + 1) * 2 ] as integer
global tmp as string
rem A Wizard Did It!
for i = 1 to maxrecord
makesprite()
next
SetPhysicsGravity ( 0, 160 ) // from 200 to 160 to prevent agk physics bug
//SetPhysicsDebugOn ( )
SetSyncRate( 60, 0 )
playagk()
AddVirtualButton( 1, 50, 120, 100 )
SetVirtualButtonColor( 1, 0, 255, 0 )
SetVirtualButtonText( 1, "Record" )
AddVirtualButton( 3, 50, 240, 100 )
SetVirtualButtonColor( 3, 0, 255, 0 )
SetVirtualButtonText( 3, "Joint" )
AddVirtualButton( 2, 50, 360, 100 )
SetVirtualButtonColor( 2, 0, 255, 0 )
SetVirtualButtonText( 2, "save" )
ang# = 0
joint = 0
do
if ( GetVirtualButtonReleased( 2 ) = 1)
fileid = OpenToWrite ( "record.txt", 0 )
for i = 0 to recordindex
tmp = "a["+Str(i*2+0)+"]="+Str( recordxy[i*2+0] )
WriteString ( fileid, tmp + ";" )
tmp = "a["+Str(i*2+1)+"]="+Str( recordxy[i*2+1] )
WriteString ( fileid, tmp + ";" )
next
WriteString ( fileid, " " )
CloseFile ( fileid )
endif
if ( GetVirtualButtonReleased( 3 ) = 1 )
if joint = 1
joint = 0
SetVirtualButtonColor( 3, 0, 255, 0 )
else
joint = 1
SetVirtualButtonColor( 3, 255, 0, 0 )
endif
endif
if ( GetVirtualButtonReleased( 1 ) = 1 or startrecord = 1 )
if GetVirtualButtonReleased( 1 ) = 1 and startrecord = 1
startrecord = 0
SetVirtualButtonColor( 1, 0, 255, 0 )
SetVirtualButtonText( 1, "Record" )
for i = 1 to maxrecord
SetSpritePhysicsOn ( mysprites [ i ] , 2 )
next
else
SetVirtualButtonColor( 1, 255, 0, 0 )
SetVirtualButtonText( 1, "Stop" )
if startrecord = 0
recordindex = 1
endif
startrecord = 1
if ( GetPointerState ( ) = 1 )
oldx# = x#
oldy# = y#
x# = GetPointerX ( )
y# = GetPointerY ( )
SetSpritePosition ( mysprites [ recordindex ] , x# , y# )
recordxy[ recordindex * 2 + 0 ] = x#
recordxy[ recordindex * 2 + 1 ] = y#
if recordindex > 1
DeleteJoint( mysprites [ recordindex ] )
if joint = 1
CreateWeldJoint( mysprites [ recordindex ], mysprites [ recordindex ], mysprites [ recordindex - 1], x#, y#, 0 )
endif
endif
SetSpritePhysicsOff ( mysprites [ recordindex ] )
recordindex = recordindex + 1
if recordindex >= maxrecord
recordindex = 1
endif
endif
endif
endif
fps = ScreenFPS ( )
Print ( fps )
Sync()
loop
function makesprite()
mysprites [ myspriteindex ] = createSprite ( 0 )
setSpriteColor ( mysprites [ myspriteindex ] , random ( 60 , 155 ) , random ( 60 , 155 ) , random ( 60 , 155 ) , 255 )
setSpriteSize ( mysprites [ myspriteindex ] , 14 , 14 )
setSpriteAngle ( mysprites [ myspriteindex ] , 0 )
SetSpritePosition( mysprites [ myspriteindex ], 1000 , 1000 )
SetSpriteShape ( mysprites [ myspriteindex ], 2 )
SetSpritePhysicsOn ( mysprites [ myspriteindex ] , 2 )
SetSpritePhysicsRestitution( mysprites [ myspriteindex ], 0 ) // 0 bounce to prevent physics agk bug
myspriteindex = myspriteindex + 1
endfunction
function playagk()
dim a [ maxrecord * 2 ] as integer
// draw agk
spritestart = 0
maxblocks = 953
a[0]=0; a[1]=0; a[2]=260; a[3]=247; a[4]=260; a[5]=247; a[6]=260; a[7]=247; a[8]=260; a[9]=247; a[10]=259; a[11]=245; a[12]=256; a[13]=240; a[14]=254; a[15]=235; a[16]=252; a[17]=231; a[18]=250; a[19]=225; a[20]=249; a[21]=220; a[22]=247; a[23]=215; a[24]=246; a[25]=210; a[26]=244; a[27]=205; a[28]=244; a[29]=201; a[30]=242; a[31]=197; a[32]=241; a[33]=195; a[34]=241; a[35]=191; a[36]=241; a[37]=186; a[38]=240; a[39]=182; a[40]=239; a[41]=176; a[42]=239; a[43]=169; a[44]=238; a[45]=164; a[46]=238; a[47]=158; a[48]=238; a[49]=153; a[50]=238; a[51]=148; a[52]=238; a[53]=144; a[54]=238; a[55]=141; a[56]=238; a[57]=138; a[58]=238; a[59]=136; a[60]=239; a[61]=130; a[62]=239; a[63]=126; a[64]=239; a[65]=121; a[66]=241; a[67]=115; a[68]=243; a[69]=109; a[70]=244; a[71]=103; a[72]=245; a[73]=99; a[74]=246; a[75]=96; a[76]=247; a[77]=93; a[78]=248; a[79]=92; a[80]=248; a[81]=90; a[82]=250; a[83]=88; a[84]=252; a[85]=86; a[86]=254; a[87]=84; a[88]=255; a[89]=82; a[90]=258; a[91]=81; a[92]=260; a[93]=80; a[94]=262; a[95]=78; a[96]=263; a[97]=78; a[98]=263; a[99]=78; a[100]=263; a[101]=78; a[102]=267; a[103]=78; a[104]=275; a[105]=76; a[106]=283; a[107]=74; a[108]=284; a[109]=74; a[110]=284; a[111]=74; a[112]=284; a[113]=74; a[114]=285; a[115]=74; a[116]=288; a[117]=74; a[118]=291; a[119]=74; a[120]=294; a[121]=74; a[122]=295; a[123]=75; a[124]=296; a[125]=75; a[126]=298; a[127]=77; a[128]=301; a[129]=79; a[130]=306; a[131]=83; a[132]=309; a[133]=87; a[134]=312; a[135]=89; a[136]=313; a[137]=91; a[138]=314; a[139]=92; a[140]=315; a[141]=94; a[142]=316; a[143]=95; a[144]=317; a[145]=96; a[146]=317; a[147]=98; a[148]=319; a[149]=101; a[150]=321; a[151]=106; a[152]=323; a[153]=110; a[154]=324; a[155]=115; a[156]=325; a[157]=117; a[158]=325; a[159]=118; a[160]=326; a[161]=119; a[162]=326; a[163]=122; a[164]=327; a[165]=125; a[166]=327; a[167]=128; a[168]=327; a[169]=132; a[170]=328; a[171]=136; a[172]=329; a[173]=141; a[174]=330; a[175]=144; a[176]=330; a[177]=148; a[178]=330; a[179]=153; a[180]=330; a[181]=156; a[182]=330; a[183]=160; a[184]=330; a[185]=165; a[186]=330; a[187]=169; a[188]=330; a[189]=175; a[190]=330; a[191]=178; a[192]=330; a[193]=182; a[194]=330; a[195]=185; a[196]=330; a[197]=187; a[198]=330; a[199]=190; a[200]=330; a[201]=194; a[202]=330; a[203]=198; a[204]=330; a[205]=200; a[206]=330; a[207]=201; a[208]=330; a[209]=202; a[210]=330; a[211]=203; a[212]=330; a[213]=205; a[214]=330; a[215]=208; a[216]=330; a[217]=211; a[218]=328; a[219]=215; a[220]=328; a[221]=218; a[222]=328; a[223]=220; a[224]=328; a[225]=220; a[226]=328; a[227]=220; a[228]=328; a[229]=222; a[230]=328; a[231]=226; a[232]=327; a[233]=230; a[234]=327; a[235]=234; a[236]=326; a[237]=236; a[238]=326; a[239]=236; a[240]=326; a[241]=236; a[242]=326; a[243]=236; a[244]=326; a[245]=236; a[246]=326; a[247]=238; a[248]=325; a[249]=243; a[250]=324; a[251]=252; a[252]=323; a[253]=255; a[254]=323; a[255]=255; a[256]=323; a[257]=255; a[258]=323; a[259]=255; a[260]=323; a[261]=251; a[262]=322; a[263]=246; a[264]=322; a[265]=245; a[266]=322; a[267]=245; a[268]=331; a[269]=166; a[270]=331; a[271]=166; a[272]=331; a[273]=166; a[274]=331; a[275]=166; a[276]=330; a[277]=166; a[278]=329; a[279]=166; a[280]=327; a[281]=167; a[282]=318; a[283]=169; a[284]=309; a[285]=170; a[286]=298; a[287]=171; a[288]=295; a[289]=172; a[290]=292; a[291]=172; a[292]=289; a[293]=172; a[294]=286; a[295]=172; a[296]=284; a[297]=173; a[298]=281; a[299]=173; a[300]=279; a[301]=173; a[302]=276; a[303]=173; a[304]=271; a[305]=173; a[306]=266; a[307]=172; a[308]=265; a[309]=172; a[310]=265; a[311]=172; a[312]=263; a[313]=172; a[314]=262; a[315]=172; a[316]=261; a[317]=172; a[318]=260; a[319]=171; a[320]=260; a[321]=171; a[322]=260; a[323]=171; a[324]=259; a[325]=171; a[326]=259; a[327]=171; a[328]=259; a[329]=171; a[330]=258; a[331]=171; a[332]=258; a[333]=171; a[334]=257; a[335]=171; a[336]=256; a[337]=171; a[338]=256; a[339]=171; a[340]=256; a[341]=171; a[342]=256; a[343]=171; a[344]=255; a[345]=171; a[346]=254; a[347]=171; a[348]=254; a[349]=171; a[350]=254; a[351]=171; a[352]=254; a[353]=171; a[354]=254; a[355]=171; a[356]=254; a[357]=171; a[358]=254; a[359]=171; a[360]=254; a[361]=171; a[362]=254; a[363]=171; a[364]=452; a[365]=67; a[366]=452; a[367]=67; a[368]=452; a[369]=67; a[370]=448; a[371]=68; a[372]=443; a[373]=69; a[374]=440; a[375]=69; a[376]=439; a[377]=69; a[378]=439; a[379]=69; a[380]=438; a[381]=69; a[382]=434; a[383]=70; a[384]=423; a[385]=73; a[386]=414; a[387]=74; a[388]=410; a[389]=76; a[390]=408; a[391]=76; a[392]=406; a[393]=77; a[394]=404; a[395]=78; a[396]=403; a[397]=79; a[398]=402; a[399]=80; a[400]=399; a[401]=82; a[402]=396; a[403]=85; a[404]=392; a[405]=89; a[406]=390; a[407]=92; a[408]=387; a[409]=96; a[410]=385; a[411]=100; a[412]=383; a[413]=105; a[414]=381; a[415]=109; a[416]=380; a[417]=113; a[418]=379; a[419]=117; a[420]=378; a[421]=120; a[422]=377; a[423]=125; a[424]=376; a[425]=129; a[426]=375; a[427]=134; a[428]=374; a[429]=141; a[430]=374; a[431]=145; a[432]=374; a[433]=150; a[434]=373; a[435]=153; a[436]=373; a[437]=158; a[438]=373; a[439]=163; a[440]=373; a[441]=167; a[442]=373; a[443]=170; a[444]=374; a[445]=174; a[446]=375; a[447]=178; a[448]=375; a[449]=183; a[450]=377; a[451]=187; a[452]=378; a[453]=190; a[454]=378; a[455]=194; a[456]=380; a[457]=197; a[458]=381; a[459]=201; a[460]=384; a[461]=206; a[462]=384; a[463]=209; a[464]=386; a[465]=213; a[466]=388; a[467]=216; a[468]=389; a[469]=220; a[470]=392; a[471]=224; a[472]=397; a[473]=229; a[474]=398; a[475]=231; a[476]=400; a[477]=232; a[478]=401; a[479]=234; a[480]=403; a[481]=235; a[482]=405; a[483]=238; a[484]=407; a[485]=240; a[486]=411; a[487]=241; a[488]=414; a[489]=242; a[490]=416; a[491]=243; a[492]=418; a[493]=244; a[494]=422; a[495]=244; a[496]=432; a[497]=245; a[498]=439; a[499]=245; a[500]=443; a[501]=246; a[502]=444; a[503]=246; a[504]=446; a[505]=246; a[506]=453; a[507]=247; a[508]=459; a[509]=246; a[510]=467; a[511]=243; a[512]=473; a[513]=242; a[514]=475; a[515]=241; a[516]=475; a[517]=241; a[518]=476; a[519]=240; a[520]=479; a[521]=237; a[522]=483; a[523]=234; a[524]=487; a[525]=230; a[526]=491; a[527]=227; a[528]=492; a[529]=225; a[530]=492; a[531]=224; a[532]=492; a[533]=222; a[534]=492; a[535]=219; a[536]=493; a[537]=217; a[538]=494; a[539]=214; a[540]=494; a[541]=211; a[542]=494; a[543]=209; a[544]=493; a[545]=205; a[546]=493; a[547]=201; a[548]=493; a[549]=196; a[550]=493; a[551]=193; a[552]=494; a[553]=189; a[554]=494; a[555]=184; a[556]=494; a[557]=183; a[558]=494; a[559]=180; a[560]=494; a[561]=177; a[562]=493; a[563]=175; a[564]=493; a[565]=174; a[566]=493; a[567]=172; a[568]=493; a[569]=171; a[570]=493; a[571]=171; a[572]=493; a[573]=170; a[574]=492; a[575]=170; a[576]=491; a[577]=169; a[578]=490; a[579]=168; a[580]=489; a[581]=168; a[582]=487; a[583]=167; a[584]=487; a[585]=167; a[586]=486; a[587]=166; a[588]=485; a[589]=165; a[590]=485; a[591]=165; a[592]=483; a[593]=165; a[594]=481; a[595]=165; a[596]=476; a[597]=165; a[598]=469; a[599]=165; a[600]=462; a[601]=166; a[602]=459; a[603]=166; a[604]=459; a[605]=166; a[606]=458; a[607]=166; a[608]=458; a[609]=167; a[610]=456; a[611]=167; a[612]=455; a[613]=167; a[614]=453; a[615]=167; a[616]=452; a[617]=167; a[618]=452; a[619]=167; a[620]=451; a[621]=167; a[622]=450; a[623]=167; a[624]=450; a[625]=167; a[626]=450; a[627]=167; a[628]=450; a[629]=167; a[630]=450; a[631]=167; a[632]=450; a[633]=167; a[634]=450; a[635]=167; a[636]=450; a[637]=167; a[638]=450; a[639]=167; a[640]=450; a[641]=167; a[642]=450; a[643]=164; a[644]=450; a[645]=162; a[646]=544; a[647]=65; a[648]=544; a[649]=65; a[650]=544; a[651]=65; a[652]=544; a[653]=65; a[654]=544; a[655]=65; a[656]=544; a[657]=66; a[658]=544; a[659]=69; a[660]=544; a[661]=72; a[662]=543; a[663]=78; a[664]=543; a[665]=86; a[666]=543; a[667]=96; a[668]=542; a[669]=103; a[670]=542; a[671]=109; a[672]=543; a[673]=113; a[674]=543; a[675]=118; a[676]=543; a[677]=123; a[678]=543; a[679]=127; a[680]=543; a[681]=132; a[682]=543; a[683]=137; a[684]=543; a[685]=142; a[686]=543; a[687]=148; a[688]=543; a[689]=153; a[690]=543; a[691]=159; a[692]=545; a[693]=162; a[694]=545; a[695]=166; a[696]=545; a[697]=168; a[698]=545; a[699]=172; a[700]=545; a[701]=177; a[702]=545; a[703]=183; a[704]=546; a[705]=189; a[706]=546; a[707]=193; a[708]=546; a[709]=197; a[710]=546; a[711]=200; a[712]=546; a[713]=202; a[714]=546; a[715]=206; a[716]=546; a[717]=209; a[718]=546; a[719]=212; a[720]=546; a[721]=216; a[722]=546; a[723]=217; a[724]=546; a[725]=219; a[726]=546; a[727]=222; a[728]=546; a[729]=225; a[730]=547; a[731]=227; a[732]=547; a[733]=230; a[734]=547; a[735]=231; a[736]=547; a[737]=233; a[738]=547; a[739]=234; a[740]=547; a[741]=234; a[742]=547; a[743]=234; a[744]=547; a[745]=235; a[746]=547; a[747]=238; a[748]=547; a[749]=242; a[750]=547; a[751]=244; a[752]=547; a[753]=246; a[754]=547; a[755]=246; a[756]=547; a[757]=246; a[758]=547; a[759]=246; a[760]=547; a[761]=248; a[762]=547; a[763]=248; a[764]=547; a[765]=248; a[766]=547; a[767]=249; a[768]=547; a[769]=253; a[770]=547; a[771]=257; a[772]=547; a[773]=257; a[774]=547; a[775]=257; a[776]=558; a[777]=154; a[778]=558; a[779]=154; a[780]=558; a[781]=154; a[782]=558; a[783]=153; a[784]=559; a[785]=152; a[786]=562; a[787]=149; a[788]=572; a[789]=142; a[790]=576; a[791]=138; a[792]=579; a[793]=136; a[794]=581; a[795]=134; a[796]=584; a[797]=132; a[798]=587; a[799]=128; a[800]=594; a[801]=122; a[802]=603; a[803]=115; a[804]=609; a[805]=109; a[806]=612; a[807]=106; a[808]=613; a[809]=104; a[810]=615; a[811]=102; a[812]=618; a[813]=98; a[814]=621; a[815]=95; a[816]=623; a[817]=93; a[818]=625; a[819]=91; a[820]=626; a[821]=89; a[822]=628; a[823]=87; a[824]=631; a[825]=85; a[826]=634; a[827]=82; a[828]=636; a[829]=80; a[830]=637; a[831]=79; a[832]=637; a[833]=79; a[834]=637; a[835]=79; a[836]=637; a[837]=79; a[838]=637; a[839]=79; a[840]=637; a[841]=79; a[842]=637; a[843]=79; a[844]=639; a[845]=77; a[846]=643; a[847]=74; a[848]=643; a[849]=74; a[850]=643; a[851]=74; a[852]=557; a[853]=162; a[854]=558; a[855]=162; a[856]=561; a[857]=163; a[858]=563; a[859]=165; a[860]=565; a[861]=167; a[862]=570; a[863]=172; a[864]=574; a[865]=176; a[866]=578; a[867]=179; a[868]=580; a[869]=182; a[870]=583; a[871]=185; a[872]=586; a[873]=188; a[874]=590; a[875]=191; a[876]=593; a[877]=194; a[878]=596; a[879]=198; a[880]=599; a[881]=202; a[882]=601; a[883]=204; a[884]=603; a[885]=206; a[886]=607; a[887]=208; a[888]=612; a[889]=212; a[890]=619; a[891]=215; a[892]=624; a[893]=217; a[894]=628; a[895]=219; a[896]=631; a[897]=222; a[898]=634; a[899]=223; a[900]=636; a[901]=226; a[902]=640; a[903]=229; a[904]=642; a[905]=231; a[906]=645; a[907]=232; a[908]=648; a[909]=234; a[910]=649; a[911]=235; a[912]=649; a[913]=237; a[914]=651; a[915]=238; a[916]=651; a[917]=240; a[918]=653; a[919]=241; a[920]=653; a[921]=241; a[922]=653; a[923]=241; a[924]=653; a[925]=242; a[926]=654; a[927]=245; a[928]=655; a[929]=246; a[930]=656; a[931]=247; a[932]=656; a[933]=247; a[934]=656; a[935]=247; a[936]=656; a[937]=247; a[938]=656; a[939]=247; a[940]=656; a[941]=247; a[942]=656; a[943]=247; a[944]=656; a[945]=247; a[946]=656; a[947]=247; a[948]=656; a[949]=247; a[950]=656; a[951]=247; a[952]=656; a[953]=247; a[954]=0; a[955]=0;
for l = 0 to 800
for i = 1 to ((maxblocks-1)/2)
SetSpritePosition ( mysprites [ i+spritestart ] , a[i*2+0] + (sin(i+l)*(800-l)) ,a[i*2+1] + (cos(i+l)*(800-l)) )
SetSpritePhysicsOff ( mysprites [ i+spritestart ] )
next i
Sync()
next l
//
for i = 1 to ((maxblocks-1)/2)
SetSpritePosition ( mysprites [ i+spritestart ] , a[i*2+0] ,a[i*2+1] )
SetSpritePhysicsOff ( mysprites [ i+spritestart ] )
next
// pause
for i = 0 to 30*1
Sync()
next
//enable physics.
for i = 1 to ((maxblocks-1)/2)
SetSpritePhysicsOn ( mysprites [ i+spritestart ] , 2 )
Sync()
next
// pause
for i = 0 to 30*6
Sync()
next
//
spritestart = 0
// fireworks
maxblocks = 224
a[0]=0; a[1]=0; a[2]=433; a[3]=474; a[4]=433; a[5]=470; a[6]=433; a[7]=462; a[8]=433; a[9]=450; a[10]=433; a[11]=440; a[12]=432; a[13]=422; a[14]=432; a[15]=407; a[16]=430; a[17]=379; a[18]=426; a[19]=359; a[20]=422; a[21]=340; a[22]=418; a[23]=320; a[24]=413; a[25]=302; a[26]=411; a[27]=285; a[28]=407; a[29]=268; a[30]=404; a[31]=248; a[32]=402; a[33]=237; a[34]=401; a[35]=225; a[36]=399; a[37]=213; a[38]=398; a[39]=203; a[40]=396; a[41]=184; a[42]=395; a[43]=176; a[44]=393; a[45]=166; a[46]=393; a[47]=155; a[48]=392; a[49]=148; a[50]=392; a[51]=136; a[52]=392; a[53]=127; a[54]=392; a[55]=120; a[56]=392; a[57]=114; a[58]=392; a[59]=110; a[60]=392; a[61]=105; a[62]=392; a[63]=101; a[64]=392; a[65]=97; a[66]=392; a[67]=94; a[68]=392; a[69]=90; a[70]=392; a[71]=87; a[72]=392; a[73]=83; a[74]=392; a[75]=80; a[76]=392; a[77]=77; a[78]=392; a[79]=75; a[80]=392; a[81]=75; a[82]=392; a[83]=75; a[84]=392; a[85]=75; a[86]=392; a[87]=75; a[88]=392; a[89]=75; a[90]=392; a[91]=75; a[92]=392; a[93]=74; a[94]=392; a[95]=74; a[96]=392; a[97]=74; a[98]=392; a[99]=74; a[100]=392; a[101]=74; a[102]=392; a[103]=74; a[104]=392; a[105]=74; a[106]=392; a[107]=74; a[108]=392; a[109]=74; a[110]=392; a[111]=74; a[112]=392; a[113]=74; a[114]=392; a[115]=74; a[116]=392; a[117]=74; a[118]=392; a[119]=74; a[120]=392; a[121]=74; a[122]=392; a[123]=74; a[124]=392; a[125]=74; a[126]=392; a[127]=74; a[128]=392; a[129]=74; a[130]=392; a[131]=74; a[132]=392; a[133]=74; a[134]=392; a[135]=74; a[136]=392; a[137]=74; a[138]=392; a[139]=74; a[140]=392; a[141]=74; a[142]=392; a[143]=74; a[144]=392; a[145]=74; a[146]=392; a[147]=74; a[148]=392; a[149]=74; a[150]=392; a[151]=74; a[152]=392; a[153]=74; a[154]=392; a[155]=74; a[156]=392; a[157]=74; a[158]=392; a[159]=74; a[160]=392; a[161]=74; a[162]=392; a[163]=74; a[164]=392; a[165]=74; a[166]=392; a[167]=74; a[168]=392; a[169]=74; a[170]=392; a[171]=74; a[172]=392; a[173]=74; a[174]=392; a[175]=74; a[176]=392; a[177]=74; a[178]=392; a[179]=74; a[180]=392; a[181]=74; a[182]=392; a[183]=74; a[184]=392; a[185]=74; a[186]=392; a[187]=74; a[188]=392; a[189]=74; a[190]=392; a[191]=74; a[192]=392; a[193]=74; a[194]=392; a[195]=74; a[196]=392; a[197]=74; a[198]=392; a[199]=74; a[200]=392; a[201]=74; a[202]=392; a[203]=74; a[204]=392; a[205]=74; a[206]=392; a[207]=74; a[208]=392; a[209]=74; a[210]=392; a[211]=74; a[212]=392; a[213]=74; a[214]=392; a[215]=74; a[216]=392; a[217]=74; a[218]=392; a[219]=74; a[220]=392; a[221]=73; a[222]=393; a[223]=72; a[224]=380; a[225]=50;
for i = 1 to ((maxblocks-1)/2)
SetSpritePosition ( mysprites [ i ] , a[i*2+0] ,a[i*2+1] )
SetSpritePhysicsOff ( mysprites [ i ] )
Sync()
next
//enable physics.
for i = 1 to maxblocks
SetSpritePhysicsOn ( mysprites [ i ] , 2 )
next
for i = 0 to 30*4
Sync()
next
spritestart = 0
maxblocks = 322
a[0]=0; a[1]=0; a[2]=412; a[3]=136; a[4]=410; a[5]=136; a[6]=409; a[7]=136; a[8]=407; a[9]=136; a[10]=406; a[11]=136; a[12]=405; a[13]=136; a[14]=403; a[15]=136; a[16]=403; a[17]=136; a[18]=402; a[19]=136; a[20]=401; a[21]=137; a[22]=401; a[23]=137; a[24]=400; a[25]=138; a[26]=400; a[27]=139; a[28]=400; a[29]=141; a[30]=399; a[31]=142; a[32]=399; a[33]=143; a[34]=399; a[35]=145; a[36]=399; a[37]=146; a[38]=399; a[39]=147; a[40]=400; a[41]=150; a[42]=401; a[43]=151; a[44]=402; a[45]=152; a[46]=403; a[47]=153; a[48]=403; a[49]=153; a[50]=404; a[51]=154; a[52]=405; a[53]=155; a[54]=406; a[55]=156; a[56]=408; a[57]=156; a[58]=409; a[59]=157; a[60]=410; a[61]=157; a[62]=410; a[63]=157; a[64]=412; a[65]=157; a[66]=413; a[67]=157; a[68]=415; a[69]=157; a[70]=416; a[71]=156; a[72]=416; a[73]=156; a[74]=416; a[75]=156; a[76]=418; a[77]=155; a[78]=420; a[79]=154; a[80]=421; a[81]=153; a[82]=422; a[83]=152; a[84]=422; a[85]=152; a[86]=422; a[87]=151; a[88]=423; a[89]=150; a[90]=423; a[91]=149; a[92]=424; a[93]=148; a[94]=424; a[95]=148; a[96]=424; a[97]=148; a[98]=424; a[99]=146; a[100]=424; a[101]=146; a[102]=424; a[103]=145; a[104]=424; a[105]=145; a[106]=422; a[107]=143; a[108]=422; a[109]=143; a[110]=421; a[111]=142; a[112]=421; a[113]=140; a[114]=420; a[115]=140; a[116]=419; a[117]=139; a[118]=418; a[119]=139; a[120]=417; a[121]=138; a[122]=416; a[123]=138; a[124]=415; a[125]=138; a[126]=414; a[127]=137; a[128]=413; a[129]=136; a[130]=410; a[131]=135; a[132]=409; a[133]=135; a[134]=408; a[135]=135; a[136]=408; a[137]=135; a[138]=408; a[139]=135; a[140]=407; a[141]=135; a[142]=407; a[143]=135; a[144]=405; a[145]=136; a[146]=402; a[147]=138; a[148]=400; a[149]=139; a[150]=400; a[151]=140; a[152]=399; a[153]=141; a[154]=399; a[155]=143; a[156]=399; a[157]=144; a[158]=398; a[159]=145; a[160]=398; a[161]=147; a[162]=398; a[163]=148; a[164]=398; a[165]=150; a[166]=398; a[167]=151; a[168]=399; a[169]=153; a[170]=400; a[171]=155; a[172]=401; a[173]=156; a[174]=403; a[175]=158; a[176]=404; a[177]=159; a[178]=407; a[179]=161; a[180]=410; a[181]=161; a[182]=413; a[183]=164; a[184]=416; a[185]=164; a[186]=418; a[187]=165; a[188]=421; a[189]=166; a[190]=422; a[191]=166; a[192]=424; a[193]=166; a[194]=424; a[195]=166; a[196]=425; a[197]=166; a[198]=425; a[199]=165; a[200]=427; a[201]=165; a[202]=430; a[203]=163; a[204]=433; a[205]=161; a[206]=433; a[207]=159; a[208]=434; a[209]=157; a[210]=435; a[211]=156; a[212]=435; a[213]=154; a[214]=435; a[215]=152; a[216]=435; a[217]=150; a[218]=435; a[219]=148; a[220]=435; a[221]=148; a[222]=434; a[223]=147; a[224]=434; a[225]=147; a[226]=434; a[227]=146; a[228]=433; a[229]=145; a[230]=432; a[231]=144; a[232]=430; a[233]=144; a[234]=429; a[235]=142; a[236]=429; a[237]=142; a[238]=427; a[239]=141; a[240]=426; a[241]=141; a[242]=424; a[243]=141; a[244]=423; a[245]=140; a[246]=421; a[247]=139; a[248]=419; a[249]=139; a[250]=415; a[251]=138; a[252]=414; a[253]=138; a[254]=411; a[255]=138; a[256]=409; a[257]=138; a[258]=408; a[259]=138; a[260]=407; a[261]=138; a[262]=407; a[263]=138; a[264]=406; a[265]=139; a[266]=403; a[267]=142; a[268]=399; a[269]=144; a[270]=398; a[271]=146; a[272]=397; a[273]=149; a[274]=397; a[275]=151; a[276]=397; a[277]=152; a[278]=396; a[279]=154; a[280]=396; a[281]=156; a[282]=396; a[283]=157; a[284]=397; a[285]=159; a[286]=398; a[287]=160; a[288]=399; a[289]=161; a[290]=400; a[291]=161; a[292]=402; a[293]=162; a[294]=404; a[295]=163; a[296]=406; a[297]=164; a[298]=408; a[299]=164; a[300]=409; a[301]=165; a[302]=412; a[303]=166; a[304]=414; a[305]=166; a[306]=414; a[307]=167; a[308]=416; a[309]=168; a[310]=417; a[311]=168; a[312]=418; a[313]=168; a[314]=418; a[315]=168; a[316]=418; a[317]=168; a[318]=421; a[319]=166; a[320]=425; a[321]=163; a[322]=388; a[323]=161;
for i = 1 to ((maxblocks-1)/2)
SetSpritePosition ( mysprites [ i+spritestart ] , a[i*2+0] ,a[i*2+1] )
SetSpritePhysicsOff ( mysprites [ i+spritestart ] )
Sync()
next
// pause
for i = 0 to 30*2
Sync()
next
//enable physics.
for i = 1 to maxblocks
SetSpritePhysicsOn ( mysprites [ i+spritestart ] , 2 )
next
// pause
for i = 0 to 30*2
Sync()
next
endfunction
Cant pinpoint the bug other then, gravity and object forces can make physics objects go into each others. And when the physics objects overlab it takes alot of calculations for the physics system to try to get them out again.
Lowering gravity and/or setting bounce ( SetSpritePhysicsRestitution ) to 0 makes it work on mobiles.
Rick: can you confirm the new version works on iPad2 ?
best regards Preben Eriksen,