PDA

View Full Version : Animation HELP



RealRitzcracker
July 25th, 2006, 00:12
Im trying to make like a animation.
Pretty much like
Trying to send
A L across the screen
then a U across the screen
then a A across the screen
and have them all meet to form
LUA
What code would I use

yaustar
July 25th, 2006, 05:32
Clue: a series of 3 while loops

Gizmo356
July 25th, 2006, 05:36
O_o

MasterChafed
July 25th, 2006, 05:37
or a series of if statements

Gizmo356
July 25th, 2006, 05:44
double O_o

Shadowblind
July 25th, 2006, 05:49
Someday I'll understand a word your saying.

Gizmo356
July 25th, 2006, 05:55
lol

yaustar
July 25th, 2006, 06:08
or a series of if statements
Ouch.. that will be one REALLY long script if you did it that way.

jman420
July 25th, 2006, 06:52
here's the simplest way I can think to do it..

white = Color.new(255,255,255)

-- L starting placement --

lx = 0

-- U starting placement --

uy = 0

-- A starting placement --

ax = 480

-- main loop --

while true do

-- if L's X placement is less then 236, raise untill 236 --

if lx <= 236 then
lx = lx +1 end

-- if U's Y placement is less then 130 raise untill 130 --

if uy <=130 then
uy = uy +1 end

-- if A's X placement is greater then 260, decrese untill 260 --

if ax >= 260 then
ax = ax -1 end

-- print L using the lx placement to assign its X render to use the variable --

screen:print(lx,130,"L",white)

-- U used a Y axis assignment forcing the final track to be from the top of the screen down --

screen:print(240,uy,"U",white)

-- and A came from the left side of the screen, so use A's X placement --

screen:print(ax,130,"A",white

flip.screen()
screen.waitVblankStart()

-- if animation complete. wait 30 frames and break program --

if ax >=260 then
screen.waitVblankStart(30)
break end

-- also you could change from break to

screen:clear()
do file("other program.lua")

afterwards to change to another program after the animation --

end

that would basicly tell the whole thing how to animate to the given positions

P.S. used If statements, and its accualy realy short code :p

MasterChafed
July 25th, 2006, 07:00
Ouch.. that will be one REALLY long script if you did it that way.

lol, i know, but i eat and breathe if statements. :P

yaustar
July 25th, 2006, 19:54
P.S. used If statements, and its accualy realy short code :p
A 'series', not a couple. ;)