Guest User

Untitled

a guest
Jun 30th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. program project1;
  2.  
  3. uses
  4. crt,graph,math;
  5.  
  6. var
  7. i : integer;
  8. x1,x2,y1,y2 : integer;
  9. Vx,Vy : integer;
  10.  
  11.  
  12. procedure wlaczgrafike();
  13. var
  14. karta, tryb : smallint;
  15. PathToDriver : string = 'D:Programy\lazarus\FPC\2.2.4\units\i386-win32';
  16. begin
  17. detectgraph(karta,tryb);
  18. InitGraph(karta,tryb,PathToDriver);
  19. end;
  20.  
  21. procedure wylaczgrafike();
  22. begin
  23. CloseGraph;
  24. end;
  25.  
  26. procedure ruchprawo();
  27. begin
  28. rectangle(100,100,600,400);
  29. SetFillStyle(solidFill, white);
  30. fillellipse(x1,y1,15,15);
  31. x1:=x1+Vx;
  32. y1:=y1+Vy;
  33. if x1=600 then
  34. ruchlewo;
  35. delay(150);
  36. cleardevice;
  37. ruchprawo;
  38. end;
  39.  
  40. procedure ruchlewo();
  41. begin
  42. rectangle(100,100,600,400);
  43. SetFillStyle(solidFill, white);
  44. fillellipse(x1,y1,15,15);
  45. x1:=x1-Vx;
  46. y1:=y1+Vy;
  47. if x1=600 then
  48. ruchprawo;
  49. delay(150);
  50. cleardevice;
  51. ruchlewo;
  52. end;
  53.  
  54. begin
  55.  
  56. x1:=100;
  57. y1:=250;
  58. Vx:=10;
  59. Vy:=0;
  60.  
  61. wlaczgrafike();
  62.  
  63. ruchprawo;
  64.  
  65. readln;
  66.  
  67. wylaczgrafike();
  68. end.
Advertisement
Add Comment
Please, Sign In to add comment