|
Post by Admin on Jan 2, 2020 12:44:39 GMT
draw.setscreen(1) width, height = draw.getsize() draw.clear(draw.black) function firework (x, y) x=-1*(((-h^2)/a+(((y-k)^2)/b))-r^2) y=-1*(((x-h)^2)/a)+((-k^2)/b)-r^2 return x return y end sleep(10000) Why does this tell me to add "end"? I think I already added it... You can’t put return statement after another. The compiler expects end statement after the first one. To return two values you can use: return x, y
|
|
14sum
Junior Member
Posts: 66
|
Post by 14sum on Jan 9, 2020 23:09:40 GMT
draw.setscreen(1) width, height = draw.getsize() draw.settitle( "FreakOut!" ) draw.clear(draw.black) width, height = draw.getsize() --add button that says "FreakOut!" y = height/2+math.random(-height/2,height/2) x = width/2+math.random(-width/2,width/2) a = y b = x n = y i = x f = y k = x q = y t = x c = y h = x kudos = math.random(0,6) for i = 0, 1000 do if kudos >= 1 then x = x + 1 y = y + 1 a = a - 1 b = b - 1 draw.point(x,y,draw.white) draw.point(a,b,draw.white) sleep(10) draw.point(a,b,draw.black) draw.point(x,y,draw.black)
end end
sleep(10000)
Why aren't the points aligned to begin with? And why is y decreasing when I added to it? Is this a problem with my programming or the program itself?
|
|
14sum
Junior Member
Posts: 66
|
Post by 14sum on Jan 14, 2020 4:46:04 GMT
Really though touch Lua is a gem. You have no idea how hard it is to find the libraries that your program has to offer. Even though I'm just a beginner, I appreciate touch Lua immensely.
|
|
14sum
Junior Member
Posts: 66
|
Post by 14sum on Jan 14, 2020 7:50:16 GMT
Hey for the sine Wave example what would be the count of one Wave
also when I try to make multiple amplitudes it gets stuck on creating sound... is there a proper way to do this?
|
|