i just starting using director MX 2004, Lingo is brand new to me.
i need help in writing the lingo script for a ball to bounce off an object when it touches it..
i have set up the boundaries as 400 x 300
i have a four sided box in the middle as
sprite3(L=133,T=121,R=260,B=161)Left Top Right and Bottom of the sprite respectively.
ball size is 34pixels in diameter
below is the script where the boudaries are set
if ballH < 0 then
hmove = 4 - random(3)
vmove = 4 - random(8)
puppetsound(1), "tone3a"
end if
if ballH > 366 then
hmove = -(4 - random(3))
vmove = 4 - random(8)
puppetsound(1), "tone3a"
end if
if ballV < 0 then
vmove = 4 - random(3)
hmove = 4 - random(8)
puppetsound(1), "tone4"
end if
if ballV > 266 then
vmove = -(4 - random(3))
hmove = 4 - random(8)
puppetsound(1), "tone4"
end if
now how do i make the ball bounce off the square ive drawn?
i need help in writing the lingo script for a ball to bounce off an object when it touches it..
i have set up the boundaries as 400 x 300
i have a four sided box in the middle as
sprite3(L=133,T=121,R=260,B=161)Left Top Right and Bottom of the sprite respectively.
ball size is 34pixels in diameter
below is the script where the boudaries are set
if ballH < 0 then
hmove = 4 - random(3)
vmove = 4 - random(8)
puppetsound(1), "tone3a"
end if
if ballH > 366 then
hmove = -(4 - random(3))
vmove = 4 - random(8)
puppetsound(1), "tone3a"
end if
if ballV < 0 then
vmove = 4 - random(3)
hmove = 4 - random(8)
puppetsound(1), "tone4"
end if
if ballV > 266 then
vmove = -(4 - random(3))
hmove = 4 - random(8)
puppetsound(1), "tone4"
end if
now how do i make the ball bounce off the square ive drawn?