home *** CD-ROM | disk | FTP | other *** search
- property pKnight, spriteNum, pOriginalLoc, pDirection
-
- on beginSprite me
- pKnight = sprite(spriteNum)
- pOriginalLoc = pKnight.loc
- end
-
- on enterFrame me
- if not pKnight.flipH then
- if pKnight.loc[1] > pKnight.width then
- pKnight.locH = pKnight.loc[1] - 2
- else
- pKnight.flipH = not pKnight.flipH
- end if
- else
- if pKnight.flipH then
- if (pKnight.loc[1] < pOriginalLoc[1]) or (pKnight.loc[1] < pOriginalLoc[1]) then
- pKnight.locH = pKnight.loc[1] + 2
- else
- pKnight.flipH = not pKnight.flipH
- end if
- end if
- end if
- end
-