Beta
×

### Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

# ARGHHHH!!!!!

#### syrupMatt (248267) writes | more than 12 years ago

0

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)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
end repeat

end moveChar

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

cancel ×

# Slashdot: News for Nerds

"Our reruns are better than theirs." -- Nick at Nite

Need an Account?

# Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

• b
• i
• p
• br
• a
• ol
• ul
• li
• dl
• dt
• dd
• em
• strong
• tt
• blockquote
• div
• quote
• ecode

### "ecode" can be used for code snippets, for example:

``<ecode>    while(1) { do_something(); } </ecode>``