Skip to content

Commit

Permalink
Fixed cordinatesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwiden committed May 3, 2012
1 parent e631ad8 commit 0817bfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
23 changes: 13 additions & 10 deletions SpriteGpu.vhd
Expand Up @@ -434,18 +434,21 @@ begin
end loop;
end if;

for i in 2 downto 0 loop
if y>=y_pos(i) and y < (y_pos(i)+spriteSize) then
if x>= x_pos(i) and x < (x_pos(i)+spriteSize) then
if sprite_brick( y - y_pos(i) )( x - x_pos(i) ) = '1' then
spriteVgaRed<="111";
spriteVgaGreen<="101";
spriteVgaBlue<="11";
detected:= true;
for i in 2 downto 0 loop
if x_pos(i) = 0 then

else
if y>=y_pos(i) and y < (y_pos(i)+spriteSize) then
if x>= x_pos(i)-32 and x < (x_pos(i)+spriteSize-32 ) then
if sprite_brick( y - y_pos(i) )( x - x_pos(i)+32 ) = '1' then
spriteVgaRed<="111";
spriteVgaGreen<="101";
spriteVgaBlue<="11";
detected:= true;
end if;
end if;
end if;
end if;
end if;

end loop;

if y>=y_pos(gubbe) and y < (y_pos(gubbe)+gubbSize) then
Expand Down
1 change: 1 addition & 0 deletions frameCounter.vhd
Expand Up @@ -57,6 +57,7 @@ architecture Behavioral of frameCounter is
put_block <= '0';
time_counter2 <= "0011";
time_counter <= "00000010000000000000000000000000";
split_legs <= 0;
elsif game_frozen = '1' then
else
counter_frame<=counter_frame + 1;
Expand Down

0 comments on commit 0817bfa

Please sign in to comment.