FBA The Creator
http://www.fbacreator.com/fbaforum/

How to work with grid-animation
http://www.fbacreator.com/fbaforum/viewtopic.php?f=5&t=206
Page 1 of 1

Author:  Dron [ Wed Jul 22, 2009 1:24 pm ]
Post subject:  How to work with grid-animation

Hello,
first of all - only worst thing than my english is my "programming".
I tried to make few independent animations program. It is working, but only in FBA, export to PC is also working, but on PPC will only flash black screen, then program ends.
I think it is because of too big memory capacity needed to run, but i do not know, how to clear it properly during program running.
Iam pretty sure, that all this program is like "scratching with left leg behind right ear" but - please be patient with me.... total beginner here.... :oops:
Thank You,
Dron



local frag = {}

-- (not used yet, name of image, image filename, grid name, size x, size y, number of frames, not used yet, position on screen x, position on screen y

frag[1]= {"anim" , "disc" , "disc36.png" , "disgrid" , 0 , 74 , 30 , 35 , 3 , 230 , 139 }
frag[2]= {"anim" , "prot" , "prot70.png" , "progrid" , 0 , 90 , 106 , 69 , 1 , 225 , 55 }
frag[3]= {"anim" , "terr" , "terr78.png" , "tergrid" , 0 , 116 , 104 , 77 , 1 , 81 , 17 }
frag[4]= {"anim" , "zerg" , "zerg70.png" , "zergrid" , 0 , 98 , 110 , 69 , 1 , 8 , 48 }


for a=1, (# frag) do
frag[a][2] = loadimage (frag[a][3])
frag[a][4] = creategrid(frag[a][2], 1, 1, frag[a][6], frag[a][7])
end


function onmainloop()


clear(0,0,0)

for a=1, (# frag) do

if mousedown() > 0 then quit() end

drawgrid(frag[a][4], frag[a][10], frag[a][11], screenwidth(), screenheight())
gridcell(frag[a][4], 0, 0, frag[a][5])

if frag[a][5] <frag[a][8] then frag[a][5] = frag[a][5] + 1
else frag[a][5] = 0
end

end



end

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/