Is anyone able to explain what this script does and (more specifically) HOW it does it? Thankyou.
property pSprite
property pSpeed
property pMaxSpeed
property pFriction
property pRotateAmt
on BeginSprite me
pSprite = me.spriteNum
pSpeed = 0
pMaxSpeed = 18
pFriction = 0.6
pRotateAmt = 10
end
on ExitFrame me
if keyPressed(123) then
sprite(pSprite).rotation = sprite(pSprite).rotation - pRotateAmt
else if keyPressed(124) then
sprite(pSprite).rotation = sprite(pSprite).rotation + pRotateAmt
end if
if keyPressed(126) then
if pSpeed < pMaxSpeed then
pSpeed = pSpeed + 1
end if
else
if pSpeed > 0 then
pSpeed = pSpeed - pFriction
end if
if pSpeed < 0 then
pSpeed = 0
end if
end if
if pSpeed > 0 then
angRad = pi() * sprite(pSprite).rotation/180.0
sprite(pSprite).loc = sprite(pSprite).loc + point(pSpeed * cos(angRad), Â
pSpeed * sin(angRad))
end if
end
property pSprite
property pSpeed
property pMaxSpeed
property pFriction
property pRotateAmt
on BeginSprite me
pSprite = me.spriteNum
pSpeed = 0
pMaxSpeed = 18
pFriction = 0.6
pRotateAmt = 10
end
on ExitFrame me
if keyPressed(123) then
sprite(pSprite).rotation = sprite(pSprite).rotation - pRotateAmt
else if keyPressed(124) then
sprite(pSprite).rotation = sprite(pSprite).rotation + pRotateAmt
end if
if keyPressed(126) then
if pSpeed < pMaxSpeed then
pSpeed = pSpeed + 1
end if
else
if pSpeed > 0 then
pSpeed = pSpeed - pFriction
end if
if pSpeed < 0 then
pSpeed = 0
end if
end if
if pSpeed > 0 then
angRad = pi() * sprite(pSprite).rotation/180.0
sprite(pSprite).loc = sprite(pSprite).loc + point(pSpeed * cos(angRad), Â
pSpeed * sin(angRad))
end if
end