## Journal Journal: ARGHHHH!!!!!

WHY DOESN'T THIS WORK@%$#@#$^@!!!!!

on moveChar whichsprite, dx, dy

ox = sprite(whichsprite).locH

oy = sprite(whichsprite).locV

--find the slope of the line between the two points

--and reduce it

slopeN = (ox - dx)

slopeD = (oy - dy)

gcd = getGCD(slopeN, slopeD)

rorX = (slopeN/gcd)

rorY = (slopeD/gcd)

put ox, oy, dx, dy, slopeN, slopeD, gcd, rorX, rorY

--move the character based on the rise over run

repeat while ((sprite(whichsprite).locH <> dx) OR (sprite(whichsprite).locV <> dy))

if (sprite(whichsprite).locH <> dx) then

sprite(whichsprite).locH = (sprite(whichsprite).locH + rorX)

end if

if (sprite(whichsprite).locV <> dy) then

sprite(whichsprite).locV = (sprite(whichsprite).locV + rorY)

end if

updateStage

end repeat

end moveChar

sigh. maybe director is ghetto and cant handle adding negative numbers?

on moveChar whichsprite, dx, dy

ox = sprite(whichsprite).locH

oy = sprite(whichsprite).locV

--find the slope of the line between the two points

--and reduce it

slopeN = (ox - dx)

slopeD = (oy - dy)

gcd = getGCD(slopeN, slopeD)

rorX = (slopeN/gcd)

rorY = (slopeD/gcd)

put ox, oy, dx, dy, slopeN, slopeD, gcd, rorX, rorY

--move the character based on the rise over run

repeat while ((sprite(whichsprite).locH <> dx) OR (sprite(whichsprite).locV <> dy))

if (sprite(whichsprite).locH <> dx) then

sprite(whichsprite).locH = (sprite(whichsprite).locH + rorX)

end if

if (sprite(whichsprite).locV <> dy) then

sprite(whichsprite).locV = (sprite(whichsprite).locV + rorY)

end if

updateStage

end repeat

end moveChar

sigh. maybe director is ghetto and cant handle adding negative numbers?