Advertisement
Guest User

joystick04_scrolloffset.bex

a guest
Nov 9th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. xof1=1016
  2. yof1=1016
  3. xof2=1016
  4. yof2=1016
  5. scratv=0
  6. scratvl=16
  7. trgp=0
  8. trgv=0
  9.  
  10. VidMode VID32CELL
  11. pokeint &hc00004,&h8700+&h0f '- border colour
  12. palette &h0FF,0,&h0f
  13.  
  14. for y=0 to 7
  15.   for x=0 to 7
  16.     settextplane scroll_a
  17.     setscrollplane scroll_a
  18.     color 1,0,0,0
  19.     locate x*8,y*8
  20.     print x;",";y;"     "
  21.     settextplane scroll_b
  22.     setscrollplane scroll_b
  23.     color 2,0,0,0
  24.     locate x*8,y*8
  25.     print x;",";y;"     "
  26.     next
  27.   next
  28.  
  29. do
  30.   a=JoyPad(0)
  31.   if (a.6) and trgp=0 then
  32.     trgp=1
  33.     trgv=trgv+1
  34.     end if
  35.   if (1-a.6) then
  36.     trgp=0
  37.     end if
  38.   if trgv>1 then
  39.     trgv=0
  40.     end if
  41.  
  42.   if trgv=0 then
  43.     palette &hEB0,1,&h01
  44.     color 1,0,0,0
  45.     settextplane scroll_a
  46.     setscrollplane scroll_a
  47.     xof1=xof1+(a.11)-(a.10)
  48.     yof1=yof1+(a.9)-(a.8)
  49.     scroll2 right,xof1
  50.     scroll2 down,1023-yof1
  51.     locate 0,0
  52.     print a;"     "
  53.     print xof1;"     "
  54.     print yof1;"     "
  55.   else
  56.     palette &h70E,2,&h01
  57.     color 2,0,0,0
  58.     settextplane scroll_b
  59.     setscrollplane scroll_b
  60.     xof2=xof2+(a.11)-(a.10)
  61.     yof2=yof2+(a.9)-(a.8)
  62.     scroll2 right,xof2
  63.     scroll2 down,1023-yof2
  64.     locate 0,0
  65.     print a;"     "
  66.     print xof2;"     "
  67.     print yof2;"     "
  68.     end if
  69.  
  70.   print
  71.   print a.6
  72.   print
  73.   print a.8
  74.   print a.9
  75.   print a.10
  76.   print a.11
  77.   sleep 1
  78.  
  79.   loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement