Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- patrz na status, mouseclk i mousebut
- -- reszte operacji olej
- meteoryty: process(Clk, counter, mouse_in, status, gameover)
- begin
- if(rising_edge(Clk) and gameover = '0') then
- if(counter = 0) then
- for i in 0 to 2 loop
- meteoryt(i).y <= meteoryt(i).y + 1 + meteoryt(i).x(0);
- if(status(0) = '1' and mouseclk = '1' and mousebut = '1') then
- mouseclk <= '0';
- mousebut <= '0';
- if(meteoryt(i).y + mmet > ypos and
- meteoryt(i).y < ypos and
- meteoryt(i).x + mmet > xpos and
- meteoryt(i).x < xpos) then
- meteoryt(i).y <= "00000000000";
- meteoryt(i).x <= random;
- score <= score + 1;
- end if;
- else
- mouseclk <= '1';
- end if;
- if(status(0) = '0') then
- mousebut <= '1';
- end if;
- end loop;
- end if;
- xpos_out <= xpos;
- ypos_out <= ypos;
- score_out <= score;
- for i in 0 to 2 loop
- if(meteoryt(i).y >= 700) then
- meteoryt(i).y <= "00000000000";
- meteoryt(i).x <= random;
- if(score >= 10) then
- score <= score - 10;
- else
- gameover <= '1';
- end if;
- end if;
- end loop;
- end if;
- end process;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement