Guest User

Petit Computer LTTP code

a guest
Apr 15th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. LOAD"SPU0:LINKTEST", FALSE
  2. load"spu1:LINKSUD", false
  3. LOAD"COL1:LINK", FALSE
  4. SPSET 1, 0, 0, 0, 0, 0, 16, 32
  5. SPOFS 1, 128, 64, 5
  6. REM THE BELOW VALUES EFFECT LINK ALOT
  7. CANMOVE=TRUE
  8. SPX=128 'LINKS X SCREEN VALUE
  9. SPY=64 'LINKS Y SCREEN VALUE
  10. MOVING=1 'WHAT DIRECTION TO MOVE LINK
  11. LINKSPEED=8 'HOW MANY PIXELS HE CAN MOVE
  12. ADDEDTIME=10 'TIME THATS PASSED
  13. ANIMTIME=20 'TIME BEFORE WE
  14. ' MOVE HIM AGAIN
  15. MOVEMENTINTERVAL=4 'AMOUNT
  16. 'OF TIME IN TICKS BEFORE
  17. ' HE GETS MOVED AGAIN
  18. facing=0
  19.  
  20. @MAIN
  21. CLS
  22. PRINT "ANIMTIME";ANIMTIME
  23. REM TIMER DEBUG DISPLAY
  24. PRINT "ADDEDTIME";ADDEDTIME
  25. REM TIMER DEBUG DISPLAY
  26.  
  27. IF BGMCHK(0)==0 THEN BGMPLAY 128 'LOOP MUSIC
  28.  
  29.  
  30. IF BUTTON(0)==1 THEN MOVING=1 REM UP LINK
  31. IF BUTTON(0)==2 THEN MOVING=2 REM DOWN LINK
  32. IF BUTTON(0)==4 THEN MOVING=3 REM LEFT LINK
  33. if button(0)==8 then moving=4 rem right link
  34. if button(0)==16 then swinging=true
  35.  
  36. IF MOVING==1 THEN GOSUB @MOVEUP
  37. IF MOVING==2 THEN GOSUB @MOVEDOWN
  38. IF MOVING==3 THEN GOSUB @MOVELEFT
  39. if moving==4 then gosub @moveright
  40. if swinging==true then gosub @linkswings
  41. if moving==2 then facing=2 rem link is facing down he can swing his sword
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. IF ADDEDTIME>ANIMTIME THEN CANANIMATE=TRUE
  49. IF ADDEDTIME>ANIMTIME THEN ANIMTIME=ADDEDTIME+MOVEMENTINTERVAL
  50. ADDEDTIME=ADDEDTIME+1
  51. CANMOVE=FALSE
  52. IF CANANIMATE==TRUE THEN CANMOVE=TRUE
  53.  
  54.  
  55. MOVING=FALSE REM IF LEFT TRUE
  56. REM LINK SKATES AROUND
  57. WAIT 1
  58.  
  59. GOTO @MAIN
  60.  
  61. @MOVEUP
  62. IF CANMOVE==FALSE THEN RETURN
  63. SPY=SPY-LINKSPEED
  64. SPSET 1,0,0,0,0,0,16,32
  65. SPOFS 1, SPX, SPY+LINKSPEED, 0
  66. SPOFS 1, SPX, SPY, 5
  67. SPANIM 1, 8, 1, 1
  68. CANANIMATE=FALSE
  69. RETURN
  70.  
  71. @MOVEDOWN
  72. IF CANMOVE==FALSE THEN RETURN
  73. SPY=SPY+LINKSPEED
  74.  
  75. SPSET 1,32,0,0,0,0,16,32
  76. SPOFS 1, SPX, SPY-LINKSPEED, 0
  77. SPOFS 1, SPX, SPY, 5
  78. SPANIM 1, 8, 1, 1
  79. CANANIMATE=FALSE
  80. RETURN
  81.  
  82. @MOVELEFT
  83. IF CANMOVE==FALSE THEN RETURN
  84. SPSET 1,16 , 0, 0, 0, 0, 16, 32
  85. SPX=SPX-LINKSPEED
  86. SPOFS 1,SPX+LINKSPEED, SPY, 0
  87. SPOFS 1, SPX, SPY, 5
  88. SPANIM 1, 6, 1, 1
  89. CANANIMATE=FALSE
  90. RETURN
  91.  
  92. @moveright
  93. if canmove==false then return
  94. spset 1, 48, 0, 0, 0, 0, 16, 32
  95. spx=spx+linkspeed
  96. spofs 1, spx-linkspeed, spy, 0
  97. spofs 1, spx, spy, 5
  98. spanim 1, 6, 1, 1
  99. cananimate=false
  100. return
  101.  
  102.  
  103. @linkswings
  104.  
  105. if facing==0 then return rem dont do this links not facing the right way
  106. if cananimate==false the return
  107. spofs 1, spx, spy, 0
  108. spset 1, 0, 1, 0, 0, 0, 32, 32
  109. spanim 1, 6, 1, 1
  110. cananimate=false
  111. return
Advertisement
Add Comment
Please, Sign In to add comment