Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 1.86 KB | None | 0 0
  1. declare (mx,my,open,hbr,napr,win,lvn) byte
  2. declare gi byte
  3. use pole.plm
  4.  
  5. use save.plm
  6.  
  7. newgame: procedure(nt)
  8. declare nt byte
  9.  call loadlevel(nt)
  10.  call drawpole
  11.  napr=1
  12.  win=0
  13.  hbr=0
  14.  open=0
  15.  call save
  16. end
  17.  
  18.  
  19.  
  20. canw: procedure(a) byte
  21. declare a byte
  22.  if (a=0)or(a=2)or(a=9)or(a=11)or(a=3) then return 1
  23.  else return 0
  24. end
  25.  
  26. fallman: procedure
  27. declare (i,a) byte
  28.  a=getelem(mx,my)
  29.  do while canw(a)=1
  30.   call showman
  31.   call pause
  32.   call hideman
  33.   my=my+1
  34.   a=getelem(mx,my)
  35.  end
  36.  my=my-1
  37. end
  38.  
  39. use stone.plm
  40.  
  41. teleport: procedure(x,y)
  42. declare (i,j,k,x,y) byte
  43.  do k=0 to 10
  44.   call setelem(mx,my,k)
  45.   call pause  
  46.  end
  47.  call setelem(mx,my,3)
  48.  do i=0 to 19
  49.   do j=0 to 14
  50.    if (getelem(i,j)=3) then do
  51.     if (mx<>i)or(my<>j) then do
  52.      x=i
  53.      y=j
  54.     end
  55.    end
  56.   end
  57.  end  
  58.  do k=0 to 10
  59.   call setelem(x,y,k)
  60.   call pause    
  61.  end
  62.  call setelem(x,y,3)
  63.  mx=x
  64.  my=y
  65.  call showman
  66. end
  67.  
  68. checkf: procedure
  69. declare a byte
  70.  a=getelem(mx,my)
  71.  if a=9 then do
  72.   call setelem(mx,my,0)
  73.   call showman
  74.   call sekira
  75.  end
  76.  if a=2 then do
  77.   call setelem(mx,my,0)
  78.   call showman
  79.   call beep
  80.   call pause
  81.   call pause
  82.   call pause
  83.   call beep
  84.   open=1
  85.  end
  86.  if a=3 then call teleport(mx,my)
  87.  if (a=11)and(open=1) then win=1
  88.  if getelem(mx,my+1)=10 then do
  89.   call showman
  90.   call beep
  91.   call newgame(lvn)
  92.  end
  93. end
  94.  
  95. use walk.plm
  96.  
  97. play: procedure(n)
  98. declare (n,pu) byte
  99.  lvn=n
  100.  call newgame(n)
  101.  call gotoxy(13,3)
  102.  if napr=1 then call putstr(.('-->',0))
  103.  else call putstr(.('<--',0))
  104.  call gotoxy(200,200)
  105.  do while win=0
  106.   pu=getch
  107.   if pu=50 then call newgame(lvn)
  108.   if pu=51 then call save
  109.   if pu=52 then call load
  110.   if hbr=0 then call walkwo(pu)
  111.   else call walkwi(pu)
  112.    
  113.   call gotoxy(13,3)
  114.   if napr=1 then call putstr(.('-->',0))
  115.   else call putstr(.('<--',0))
  116.   call gotoxy(200,200)
  117.  end
  118. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement