Advertisement
Guest User

Untitled

a guest
May 26th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.14 KB | None | 0 0
  1. -- patrz na status, mouseclk i mousebut
  2. -- reszte operacji olej
  3. meteoryty: process(Clk, counter, mouse_in, status, gameover)
  4.     begin
  5.     if(rising_edge(Clk) and gameover = '0') then
  6.         if(counter = 0) then
  7.             for i in 0 to 2 loop
  8.                 meteoryt(i).y <= meteoryt(i).y + 1 + meteoryt(i).x(0);
  9.                 if(status(0) = '1' and mouseclk = '1' and mousebut = '1') then
  10.                     mouseclk <= '0';
  11.                     mousebut <= '0';
  12.                     if(meteoryt(i).y + mmet > ypos and
  13.                         meteoryt(i).y < ypos and
  14.                         meteoryt(i).x + mmet > xpos and
  15.                         meteoryt(i).x < xpos) then
  16.                        
  17.                         meteoryt(i).y <= "00000000000";
  18.                         meteoryt(i).x <= random;
  19.                         score <= score + 1;
  20.                     end if;
  21.                 else
  22.                     mouseclk <= '1';
  23.                 end if;
  24.                 if(status(0) = '0') then
  25.                     mousebut <= '1';
  26.                 end if;
  27.             end loop;  
  28.         end if;
  29.         xpos_out <= xpos;
  30.         ypos_out <= ypos;
  31.         score_out <= score;
  32.        
  33.         for i in 0 to 2 loop
  34.             if(meteoryt(i).y >= 700) then
  35.                 meteoryt(i).y <= "00000000000";
  36.                 meteoryt(i).x <= random;
  37.                
  38.                 if(score >= 10) then
  39.                     score <= score - 10;
  40.                 else
  41.                     gameover <= '1';
  42.                 end if;
  43.             end if;
  44.         end loop;
  45.        
  46.        
  47.         end if;
  48.     end process;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement