home *** CD-ROM | disk | FTP | other *** search
- property sd, spriteNum, currFrame, pAnimating, sFrame, eFrame, pFirstUpdate, skipframe, speed, pDirFacing, pIdleLoop, pMaxSpeed, QueueList, pLeftHand, pRightHand, pWasMovingOnY, pIdleLooped, pLastMoveTime, pDestY, skipMax, pLastDir, pQueueSprites, pLastAction, pLastActionCount, moveToX, moveToY, pAccelRate, pIdling, pIdleSFrame, pIdleEFrame, pCurrIdle, pCurrIdleFrame, pTraySprite1, pTraySprite2, pFlagSprite1, pFlagSprite2, pLastPoint, pTutFed, pDebuggin
- global gGameUpgrades, gDoingTutorial, gTutorialStep, gScoreVals
-
- on beginSprite me
- sd = sprite(spriteNum)
- pIldeLoop = 0
- speed = 0.0
- pMaxSpeed = 4
- pDestY = 0
- pAnimating = 1
- skipframe = 1
- sFrame = 1
- eFrame = 16
- currFrame = 1
- pAccelRate = 0.29999999999999999
- QueueList = []
- pLeftHand = [#type: EMPTY, #for: 0]
- pRightHand = [#type: EMPTY, #for: 0]
- pDirFacing = 1
- pTutFed = []
- sprite(pTraySprite1).visible = 0
- sprite(pTraySprite2).visible = 0
- sprite(pTraySprite1).locZ = pTraySprite1
- sprite(pTraySprite2).locZ = pTraySprite2
- skipMax = 4
- pLastAction = EMPTY
- pLastActionCount = 0
- pQueueSprites = []
- repeat with b = 410 to 430
- append(pQueueSprites, b)
- end repeat
- pFirstUpdate = 1
- pLastPoint = []
- repeat with b = 325 to 329
- sprite(b).locZ = 110 - (b - 324)
- sprite(b).visible = 0
- end repeat
- pDebuggin = 0
- end
-
- on StopMoving me
- QueueList = []
- speed = 0.0
- repeat with b = 410 to 430
- sendSprite(b, #turnOff)
- end repeat
- repeat with b = 325 to 329
- sprite(b).locZ = 110 - (b - 324)
- sprite(b).visible = 0
- end repeat
- end
-
- on DebugMe me
- pDebuggin = 1
- end
-
- on ScoreThis me, act
- if act = pLastAction then
- pLastActionCount = pLastActionCount + 1
- else
- pLastAction = act
- pLastActionCount = 1
- end if
- act = pLastAction
- if pLastAction = "order" then
- sco = gScoreVals.TakeOrder
- else
- if pLastAction = "food" then
- sco = gScoreVals.GiveFood
- else
- if pLastAction = "check" then
- sco = gScoreVals.GiveCheck
- else
- if pLastAction = "clean" then
- sco = gScoreVals.CleanUp
- else
- if pLastAction = "snack1" then
- sco = gScoreVals.GiveSnack
- else
- if pLastAction = "snack2" then
- sco = gScoreVals.GiveSnack
- end if
- end if
- end if
- end if
- end if
- end if
- DrawScoreText(act, pLastActionCount, sco * pLastActionCount, 0, sd.loc)
- AddToScore(sco * pLastActionCount)
- end
-
- on update me
- if pFirstUpdate then
- pFirstUpdate = 0
- end if
- if QueueList.count > 0 then
- MoveTo(me, QueueList[1].movePoint, QueueList[1].sprite)
- if QueueList.count = 0 then
- sd.flipH = 0
- AlignObjectToHand(me)
- end if
- else
- if (GetTime() > (pLastMoveTime + 1)) and (pIdling = 0) and (pLeftHand.type = EMPTY) and (pRightHand.type = EMPTY) then
- pIdling = 1
- pDirFacing = 1
- pCurrIdle = 1
- if sd.loc = sprite(675).loc then
- pCurrIdle = 9
- end if
- if pCurrIdle = 1 then
- pIdleSFrame = 193
- pIdleEFrame = 225
- pIdleLoop = 1
- skipMax = 4
- else
- if pCurrIdle = 2 then
- pIdleSFrame = 227
- pIdleEFrame = 243
- pIdleLoop = 1
- skipMax = 4
- else
- if pCurrIdle = 3 then
- pIdleSFrame = 244
- pIdleEFrame = 260
- pIdleLoop = 0
- skipMax = 4
- else
- if pCurrIdle = 4 then
- pIdleSFrame = 261
- pIdleEFrame = 277
- pIdleLoop = 0
- skipMax = 4
- else
- if pCurrIdle = 5 then
- pIdleSFrame = 278
- pIdleEFrame = 303
- pIdleLoop = 0
- skipMax = 4
- else
- if pCurrIdle = 6 then
- pIdleSFrame = 404
- pIdleEFrame = 431
- pIdleLoop = 1
- skipMax = 4
- else
- if pCurrIdle = 7 then
- pIdleSFrame = 432
- pIdleEFrame = 460
- pIdleLoop = 0
- skipMax = 4
- else
- if pCurrIdle = 8 then
- pIdleSFrame = 461
- pIdleEFrame = 489
- pIdleLoop = 0
- skipMax = 4
- else
- if pCurrIdle = 9 then
- pIdleSFrame = 278
- pIdleEFrame = 287
- pIdleLoop = 1
- skipMax = 4
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- pCurrIdleFrame = pIdleSFrame
- sd.flipH = 0
- end if
- pAnimating = 0
- end if
- if pIdling then
- if skipframe >= skipMax then
- skipframe = 1
- sd.memberNum = pCurrIdleFrame
- pCurrIdleFrame = pCurrIdleFrame + 2
- if pCurrIdle < 9 then
- if pCurrIdleFrame > pIdleEFrame then
- if pIdleLoop = 0 then
- pIdling = 0
- pLastMoveTime = GetTime()
- end if
- if pCurrIdle = 1 then
- pIdleSFrame = 199
- end if
- pCurrIdleFrame = pIdleSFrame
- end if
- else
- if (pCurrIdleFrame > pIdleEFrame) and (pIdleEFrame = 287) then
- pIdleSFrame = 362
- pIdleEFrame = 373
- pCurrIdleFrame = 362
- pIdleLooped = 0
- else
- if pCurrIdleFrame > pIdleEFrame then
- pIdleLooped = pIdleLooped + 1
- pCurrIdleFrame = pIdleSFrame
- if pIdleLooped = 3 then
- pIdleLoop = 0
- pIdleSFrame = 373
- pIdleEFrame = 402
- pCurrIdleFrame = 373
- else
- if pIdleLooped = 4 then
- pIdling = 0
- pLastMoveTime = GetTime()
- end if
- end if
- end if
- end if
- end if
- else
- skipframe = skipframe + 1
- end if
- end if
- if pAnimating then
- if skipframe >= skipMax then
- skipframe = 1
- currFrame = currFrame + 2
- if currFrame > eFrame then
- currFrame = sFrame
- end if
- sd.flipH = 0
- AlignObjectToHand(me)
- else
- skipframe = skipframe + 1
- end if
- end if
- end
-
- on AlignObjectToHand me
- global gTrayOffsets
- if (pLeftHand.type = EMPTY) and (pRightHand.type = EMPTY) then
- if pDirFacing = 1 then
- sd.memberNum = currFrame
- else
- if pDirFacing = 2 then
- sd.memberNum = currFrame + 16
- else
- if pDirFacing = 3 then
- sd.memberNum = currFrame + 32
- else
- if pDirFacing = 4 then
- sd.memberNum = currFrame + 16
- sd.flipH = 1
- end if
- end if
- end if
- end if
- return
- else
- if (pLeftHand.type <> EMPTY) and (pRightHand.type <> EMPTY) then
- sprite(pTraySprite1).locZ = pTraySprite1
- sprite(pTraySprite2).locZ = pTraySprite2
- if pDirFacing = 1 then
- sd.memberNum = currFrame + 48
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[1]
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[2]
- else
- if pDirFacing = 2 then
- sd.memberNum = currFrame + 16 + 48
- sprite(pTraySprite2).locZ = 109
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[3]
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[4]
- else
- if pDirFacing = 3 then
- sd.memberNum = currFrame + 32 + 48
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[5]
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[6]
- else
- if pDirFacing = 4 then
- sd.memberNum = currFrame + 16 + 48
- sd.flipH = 1
- sprite(pTraySprite1).locZ = 109
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[7]
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[8]
- end if
- end if
- end if
- end if
- else
- if pLeftHand.type <> EMPTY then
- sprite(pTraySprite1).locZ = pTraySprite1
- if pDirFacing = 1 then
- sd.memberNum = currFrame + 96
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[1]
- else
- if pDirFacing = 2 then
- sd.memberNum = currFrame + 16 + 96
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[3]
- else
- if pDirFacing = 3 then
- sd.memberNum = currFrame + 32 + 96
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[5]
- else
- if pDirFacing = 4 then
- sd.memberNum = currFrame + 16 + 144
- sd.flipH = 1
- sprite(pTraySprite1).locZ = 109
- sprite(pTraySprite1).loc = sd.loc + gTrayOffsets[7]
- end if
- end if
- end if
- end if
- else
- if pRightHand.type <> EMPTY then
- sprite(pTraySprite2).locZ = pTraySprite2
- if pDirFacing = 1 then
- sd.memberNum = currFrame + 144
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[2]
- else
- if pDirFacing = 2 then
- sd.memberNum = currFrame + 16 + 144
- sprite(pTraySprite2).locZ = 109
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[4]
- else
- if pDirFacing = 3 then
- sd.memberNum = currFrame + 32 + 144
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[6]
- else
- if pDirFacing = 4 then
- sd.memberNum = currFrame + 16 + 96
- sd.flipH = 1
- sprite(pTraySprite2).loc = sd.loc + gTrayOffsets[8]
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- if pLeftHand.type = "food" then
- sprite(pFlagSprite1).loc = sprite(pTraySprite1).loc + point(5, -5)
- sprite(pFlagSprite1).locZ = sprite(pTraySprite1).locZ
- end if
- if pRightHand.type = "food" then
- sprite(pFlagSprite2).loc = sprite(pTraySprite2).loc + point(5, -5)
- sprite(pFlagSprite2).locZ = sprite(pTraySprite2).locZ
- end if
- end
-
- on TakeMyOrder me, spr
- fre = 0
- if pLeftHand.type = EMPTY then
- fre = fre + 1
- pLeftHand.type = "order"
- pLeftHand.for = spr
- sendSprite(3, #Flashy)
- ScoreThis(me, "order")
- sprite(pTraySprite1).visible = 1
- sprite(pTraySprite1).memberNum = 341
- else
- if pRightHand.type = EMPTY then
- fre = fre + 1
- pRightHand.type = "order"
- pRightHand.for = spr
- sendSprite(3, #Flashy)
- ScoreThis(me, "order")
- sprite(pTraySprite2).visible = 1
- sprite(pTraySprite2).memberNum = 341
- end if
- end if
- if gDoingTutorial then
- if gTutorialStep = 10 then
- if (pLeftHand.type = "order") and (pRightHand.type = "order") then
- sendSprite(836, #show, 11)
- end if
- end if
- end if
- AlignObjectToHand(me)
- return fre
- end
-
- on TakeTheFood me, spr, flagNum
- if pLeftHand.type = EMPTY then
- pLeftHand.type = "food"
- pLeftHand.for = spr
- sendSprite(spr, #TurnOnFlag)
- sprite(pFlagSprite1).visible = 1
- sprite(pFlagSprite1).memberNum = flagNum
- sprite(pTraySprite1).visible = 1
- sprite(pTraySprite1).memberNum = 342
- else
- if pRightHand.type = EMPTY then
- pRightHand.type = "food"
- pRightHand.for = spr
- sendSprite(spr, #TurnOnFlag)
- sprite(pFlagSprite2).visible = 1
- sprite(pFlagSprite2).memberNum = flagNum
- sprite(pTraySprite2).visible = 1
- sprite(pTraySprite2).memberNum = 342
- end if
- end if
- AlignObjectToHand(me)
- end
-
- on TakeDrinks me
- fre = 0
- if pLeftHand.type = EMPTY then
- fre = fre + 1
- pLeftHand.type = "drink"
- pLeftHand.for = 50
- pLastAction = EMPTY
- sendSprite(13, #Take)
- sprite(pTraySprite1).visible = 1
- sprite(pTraySprite1).memberNum = 344
- else
- if pRightHand.type = EMPTY then
- fre = fre + 1
- pRightHand.type = "drink"
- pRightHand.for = 50
- pLastAction = EMPTY
- sendSprite(13, #Take)
- sprite(pTraySprite2).visible = 1
- sprite(pTraySprite2).memberNum = 344
- end if
- end if
- AlignObjectToHand(me)
- return fre
- end
-
- on TakeMilkShakes me
- fre = 0
- if spriteNum = 115 then
- if (pLeftHand.type <> EMPTY) and (pRightHand.type <> EMPTY) then
- if pLeftHand.type = "icecream" then
- pLeftHand.type = "milkshake"
- sprite(pTraySprite1).memberNum = 345
- else
- if pRightHand.type = "icecream" then
- pRightHand.type = "milkshake"
- sprite(pTraySprite2).memberNum = 345
- end if
- end if
- end if
- end if
- if pLeftHand.type = EMPTY then
- fre = fre + 1
- pLeftHand.type = "milkshake"
- pLeftHand.for = 1
- sprite(pTraySprite1).visible = 1
- sprite(pTraySprite1).memberNum = 345
- else
- if pRightHand.type = EMPTY then
- fre = fre + 1
- pRightHand.type = "milkshake"
- pRightHand.for = 1
- sprite(pTraySprite2).visible = 1
- sprite(pTraySprite2).memberNum = 345
- end if
- end if
- AlignObjectToHand(me)
- return fre
- end
-
- on TakeIceCream me
- fre = 0
- if spriteNum = 115 then
- if (pLeftHand.type <> EMPTY) and (pRightHand.type <> EMPTY) then
- if pLeftHand.type = "milkshake" then
- pLeftHand.type = "icecream"
- sprite(pTraySprite1).memberNum = 346
- else
- if pRightHand.type = "milkshake" then
- pRightHand.type = "icecream"
- sprite(pTraySprite2).memberNum = 346
- end if
- end if
- end if
- end if
- if pLeftHand.type = EMPTY then
- fre = fre + 1
- pLeftHand.type = "icecream"
- pLeftHand.for = 1
- sprite(pTraySprite1).visible = 1
- sprite(pTraySprite1).memberNum = 346
- else
- if pRightHand.type = EMPTY then
- fre = fre + 1
- pRightHand.type = "icecream"
- pRightHand.for = 1
- sprite(pTraySprite2).visible = 1
- sprite(pTraySprite2).memberNum = 346
- end if
- end if
- AlignObjectToHand(me)
- return fre
- end
-
- on GotMyDrink me, spr
- if pLeftHand.type = "drink" then
- return 1
- else
- if pRightHand.type = "drink" then
- return 1
- end if
- end if
- end
-
- on GiveDrink me, spr
- if pLeftHand.type = "drink" then
- pLeftHand.type = EMPTY
- pLeftHand.for = 0
- sprite(pTraySprite1).visible = 0
- else
- if pRightHand.type = "drink" then
- pRightHand.type = EMPTY
- pRightHand.for = 0
- sprite(pTraySprite2).visible = 0
- end if
- end if
- end
-
- on TakeOrders me
- ords = []
- if pLeftHand.type = "order" then
- append(ords, pLeftHand.for)
- pLeftHand.type = EMPTY
- pLeftHand.for = 0
- sprite(pTraySprite1).visible = 0
- end if
- if pRightHand.type = "order" then
- append(ords, pRightHand.for)
- pRightHand.type = EMPTY
- pRightHand.for = 0
- sprite(pTraySprite2).visible = 0
- end if
- sendSprite(3, #FlashOff)
- return ords
- end
-
- on dumpFood me, spr
- if (pLeftHand.type = "food") and (pLeftHand.for = spr) then
- pLeftHand.type = "trash"
- sendSprite(6, #Flashy)
- sprite(pTraySprite1).memberNum = 343
- sprite(pFlagSprite1).visible = 0
- return
- else
- if (pRightHand.type = "food") and (pRightHand.for = spr) then
- pRightHand.type = "trash"
- sendSprite(6, #Flashy)
- sprite(pTraySprite2).memberNum = 343
- sprite(pFlagSprite2).visible = 0
- return
- end if
- end if
- end
-
- on TakeMyTrash me, spr
- fre = 0
- if pLeftHand.type = EMPTY then
- fre = fre + 1
- pLeftHand.type = "trash"
- pLeftHand.for = spr
- sendSprite(6, #Flashy)
- ScoreThis(me, "clean")
- sprite(pTraySprite1).visible = 1
- sprite(pTraySprite1).memberNum = 343
- else
- if pRightHand.type = EMPTY then
- fre = fre + 1
- pRightHand.type = "trash"
- pRightHand.for = spr
- sendSprite(6, #Flashy)
- ScoreThis(me, "clean")
- sprite(pTraySprite2).visible = 1
- sprite(pTraySprite2).memberNum = 343
- end if
- end if
- if gDoingTutorial then
- if gTutorialStep = 15 then
- if (pLeftHand.type = "trash") and (pRightHand.type = "trash") then
- sendSprite(836, #show, 16)
- end if
- end if
- end if
- AlignObjectToHand(me)
- return fre
- end
-
- on GarbageCheck me
- return [pLeftHand.type, pRightHand.type]
- end
-
- on DumpTheTrash me
- sou = 0
- if (pLeftHand.type = "trash") or (pLeftHand.type = "drink") or (pLeftHand.type = "milkshake") or (pLeftHand.type = "icecream") then
- pLeftHand.type = EMPTY
- pLeftHand.for = 0
- sou = 1
- sprite(pTraySprite1).visible = 0
- end if
- if (pRightHand.type = "trash") or (pRightHand.type = "drink") or (pRightHand.type = "milkshake") or (pRightHand.type = "icecream") then
- pRightHand.type = EMPTY
- pRightHand.for = 0
- sou = 1
- sprite(pTraySprite2).visible = 0
- end if
- put "sou", sou
- if sou then
- put "playing garbage sound"
- playSound(8, "garbage 2")
- end if
- sendSprite(6, #FlashOff)
- AlignObjectToHand(me)
- end
-
- on YouGotMyFood me, spr
- if pLeftHand.type = "food" then
- if pLeftHand.for = spr then
- pLeftHand.type = EMPTY
- pLeftHand.for = 0
- AlignObjectToHand(me)
- ScoreThis(me, "food")
- sprite(pTraySprite1).visible = 0
- sprite(pFlagSprite1).visible = 0
- if gDoingTutorial then
- if gTutorialStep = 12 then
- if (pLeftHand.type = EMPTY) and (pRightHand.type = EMPTY) then
- sendSprite(836, #show, 13)
- end if
- end if
- end if
- return 1
- end if
- end if
- if pRightHand.type = "food" then
- if pRightHand.for = spr then
- pRightHand.type = EMPTY
- pRightHand.for = 0
- AlignObjectToHand(me)
- ScoreThis(me, "food")
- sprite(pTraySprite2).visible = 0
- sprite(pFlagSprite2).visible = 0
- if gDoingTutorial then
- if gTutorialStep = 12 then
- if (pLeftHand.type = EMPTY) and (pRightHand.type = EMPTY) then
- sendSprite(836, #show, 13)
- end if
- end if
- end if
- return 1
- end if
- end if
- return 0
- end
-
- on GotMyBill me, spr
- if (pLeftHand.type = EMPTY) or (pRightHand.type = EMPTY) then
- ScoreThis(me, "check")
- AlignObjectToHand(me)
- return 1
- end if
- return 0
- end
-
- on GotMySnack me, spr, typ
- if typ = 1 then
- want = "milkshake"
- else
- want = "icecream"
- end if
- if pLeftHand.type = want then
- pLeftHand.type = EMPTY
- pLeftHand.for = 0
- AlignObjectToHand(me)
- ScoreThis(me, "snack" & string(typ))
- sprite(pTraySprite1).visible = 0
- return 1
- else
- if pRightHand.type = want then
- pRightHand.type = EMPTY
- pRightHand.for = 0
- AlignObjectToHand(me)
- ScoreThis(me, "snack" & string(typ))
- sprite(pTraySprite2).visible = 0
- return 1
- end if
- end if
- return 0
- end
-
- on QueueMe me, spr, pt
- if QueueList.count >= 21 then
- put "too much already queue'd"
- return
- end if
- if spriteNum = 110 then
- playSound(9, "queue1")
- else
- if spriteNum = 115 then
- playSound(9, "queue1")
- end if
- end if
- if (spr < 10) or (spr = 13) or (spr = 30) or (spr = 31) then
- pt[2] = 105
- end if
- nextStop = [#sprite: spr, #movePoint: pt, #markSprite: pQueueSprites[1]]
- append(QueueList, nextStop)
- pAnimating = 1
- pIdling = 0
- skipMax = 2
- sendSprite(pQueueSprites[1], #turnOn, spr)
- deleteAt(pQueueSprites, 1)
- if QueueList.count = 1 then
- ChooseDirection(me, QueueList[1].movePoint)
- end if
- end
-
- on wipehelparray me
- pTutFed = []
- end
-
- on GotFreeHand me
- if (pLeftHand.type = EMPTY) or (pRightHand.type = EMPTY) then
- return 1
- end if
- end
-
- on InMyHands me
- put pLeftHand
- put pRightHand
- end
-
- on CheckIntersect me
- global gCollisionRects
- c = gCollisionRects.count
- repeat with b = 1 to c
- if (sd.locH > gCollisionRects[b].rect.left) and (sd.locH < gCollisionRects[b].rect.right) then
- if (sd.locV > gCollisionRects[b].rect.top) and (sd.locV < gCollisionRects[b].rect.bottom) then
- if pDebuggin then
- put "we collided with rect", gCollisionRects[b], sd.loc
- end if
- return gCollisionRects[b].rect
- exit repeat
- end if
- end if
- end repeat
- return rect(0, 0, 0, 0)
- end
-
- on ChooseDirection me, pt
- dX = sd.locH - pt[1]
- dY = sd.locV - pt[2]
- moveToX = 0
- moveToY = 0
- if abs(dX) >= abs(dY) then
- moveToX = pt[1]
- else
- moveToY = pt[2]
- end if
- if (pt[2] < 200) and (sd.locV < 200) then
- moveToX = pt[1]
- moveToY = 0
- else
- if pt[2] < 200 then
- moveToY = pt[2]
- moveToX = 0
- else
- if sd.locV < 200 then
- moveToX = pt[1]
- moveToY = 0
- else
- if sd.locV > 200 then
- if (sd.locV < pt[2]) and (sd.locH > pt[1]) then
- moveToX = pt[1]
- moveToY = 0
- end if
- end if
- end if
- end if
- end if
- if pDebuggin then
- put "choose dir", pt, moveToX, moveToY, dX, dY
- end if
- end
-
- on MoveTo me, pt, spr
- if pDebuggin then
- put "moveTo", pt, spr, speed, moveToX, moveToY, sd.loc
- end if
- speed = speed + pAccelRate
- if speed > pMaxSpeed then
- speed = pMaxSpeed
- if spriteNum = 110 then
- if pLastPoint.count > 0 then
- deleteAt(pLastPoint, pLastPoint.count)
- end if
- end if
- else
- if pAccelRate > 0 then
- addAt(pLastPoint, 1, sd.loc)
- if pLastPoint.count > 5 then
- deleteAt(pLastPoint, 6)
- end if
- else
- if (pAccelRate < 0) and (speed < 1.0) then
- speed = 1.0
- else
- if pAccelRate < 0 then
- if pLastPoint.count > 0 then
- deleteAt(pLastPoint, pLastPoint.count)
- end if
- end if
- end if
- end if
- end if
- lastH = sd.locH
- lastY = sd.locV
- if (abs(sd.locH - pt[1]) < 25) and (abs(sd.locV - pt[2]) < 25) and (pt[2] > 105) then
- pAccelRate = -1 * abs(pAccelRate)
- currFrame = 1
- end if
- if moveToX > 0 then
- if sd.locH <= moveToX then
- sd.locH = sd.locH + speed
- if sd.locH >= moveToX then
- sd.locH = moveToX
- moveToY = pt[2]
- moveToX = 0
- end if
- else
- if sd.locH >= moveToX then
- sd.locH = sd.locH - speed
- if sd.locH <= moveToX then
- sd.locH = moveToX
- moveToY = pt[2]
- moveToX = 0
- end if
- else
- end if
- end if
- amountIn = CheckIntersect(me)
- if pDebuggin then
- put "hit something?", amountIn
- end if
- if amountIn <> rect(0, 0, 0, 0) then
- if sd.locH < lastH then
- sd.locH = amountIn.right
- else
- sd.locH = amountIn.left
- end if
- moveToX = 0
- put "move to x", 0
- if sd.locV >= pt[2] then
- moveToY = amountIn.top
- else
- moveToY = amountIn.bottom
- end if
- end if
- else
- if moveToY > 0 then
- if sd.locV < moveToY then
- sd.locV = sd.locV + speed
- if sd.locV >= moveToY then
- sd.locV = moveToY
- moveToX = pt[1]
- moveToY = 0
- end if
- else
- if sd.locV > moveToY then
- sd.locV = sd.locV - speed
- if sd.locV <= moveToY then
- sd.locV = moveToY
- moveToX = pt[1]
- moveToY = 0
- end if
- else
- end if
- end if
- amountIn = CheckIntersect(me)
- if pDebuggin then
- put "hit something? y", amountIn, lastY, sd.locV
- end if
- if amountIn <> rect(0, 0, 0, 0) then
- if sd.locV < lastY then
- sd.locV = amountIn.bottom
- else
- sd.locV = amountIn.top
- end if
- moveToY = 0
- put "move to y", 0
- if sd.locH >= pt[1] then
- moveToX = amountIn.left
- else
- moveToX = amountIn.right
- end if
- end if
- end if
- end if
- if sd.locH > lastH then
- pDirFacing = 4
- else
- if sd.locH < lastH then
- pDirFacing = 2
- else
- if sd.locV > lastY then
- pDirFacing = 1
- else
- if sd.locV < lastY then
- pDirFacing = 3
- end if
- end if
- end if
- end if
- if sd.loc = pt then
- if pDebuggin then
- put "we're there", sd.loc, pt
- end if
- speed = 0.0
- pAccelRate = abs(pAccelRate)
- if spr = 675 then
- pLastAction = EMPTY
- end if
- sendSprite(spr, #WhatDoYouWant)
- pLastMoveTime = GetTime()
- pDestY = 0
- sendSprite(QueueList[1].markSprite, #turnOff)
- append(pQueueSprites, QueueList[1].markSprite)
- deleteAt(QueueList, 1)
- pLastPoint = []
- repeat with b = 325 to 329
- sprite(b).visible = 0
- end repeat
- if QueueList.count > 0 then
- if pDebuggin then
- put "need to choose dir", pDirFacing
- end if
- ChooseDirection(me, QueueList[1].movePoint)
- else
- currFrame = sFrame
- if (spr >= 15) and (spr <= 28) then
- pDirFacing = 4
- else
- if (spr >= 40) and (spr <= 69) then
- pDirFacing = 4
- else
- pDirFacing = 1
- end if
- end if
- end if
- end if
- end
-
- on getPropertyDescriptionList
- vPDList = [:]
- setaProp(vPDList, #pTraySprite1, [#comment: "left tray:", #format: #integer, #default: 111])
- setaProp(vPDList, #pTraySprite2, [#comment: "right tray:", #format: #integer, #default: 112])
- setaProp(vPDList, #pFlagSprite1, [#comment: "left flag:", #format: #integer, #default: 113])
- setaProp(vPDList, #pFlagSprite2, [#comment: "right flag:", #format: #integer, #default: 114])
- return vPDList
- end
-