I'm doing a fpga project in vhdl for my studies.
I'm displaying a dog on the screen that I try to move. That works well for right, left and up but trying to make the dog go down, it moves in a strange way: it's like the dog "scrolls", it's hard to describe but its not the dog that moves its kind of a window that moves on a list of following dogs.
If i move the
else Spot <= '0' part of the code , other directions (right and down) became invalid (same error) .
here is link of the video: https://www.youtube.com/watch?v=npoi_ITIuNg
Here is the full code: https://dl.dropbox.com/u/67429007/Desktop.rar
Here is the bugging (I think) code part:
begin if clk25'event and clk25='1' then if Compteur_pixels >= origineX and compteur_pixels < origineX + tailleX and compteur_lignes >= origineY and compteur_lignes < origineY + tailleY then Spot <= dog (ligne,Pixel); --dog and is an array of 0 and 1 Pixel := Pixel+1; if pixel >= tailleX then pixel := 0; ligne := ligne + 1; if ligne >= tailleY then ligne := 0; else Spot <= '0'; if direction = "00011100" then -- right key pressed (A) if originex < 700 then originex := origineX + 1; --increment X origin of dog end if; elsif direction = "00011010" then -- left (w) if originex > 83 then originex := origineX - 1; end if; elsif direction = "00111010" then -- up if originey > 46 then originey := originey - 1; end if; elsif direction = "01000010" then -- down if originey < 450 then originey := originey + 1; end if; end if; end if; end if; end if; end if ; end process ;