CataM
Advanced Member level 4
- Joined
- Dec 23, 2015
- Messages
- 1,275
- Helped
- 314
- Reputation
- 628
- Reaction score
- 312
- Trophy points
- 83
- Location
- Madrid, Spain
- Activity points
- 8,409
Hello guys,
I am facing the weirdest thing I could have expected in my game on the 640x480 VGA.
I am using Spartan-3 board which displays a game on the 640x480 screen monitor via VGA port.
I am using the following horizontal and vertical scan line configuration as per the User Guide of the Manufacturer (XILINX).
scan line: back porch --> Sync Pulse --> Front porch --> Visible area
Horizontally: Back porch = 48 , SyncPulse = 96, Front Porch = 16, Visible area=640.
Vertically: Back porch = 29 , SyncPulse = 2, Front Porch = 10, Visible area=480.
Even though the screen is a bit mis placed because of the placement or length of the porches, the real problem is the ball.
The problem is the ball is hitting some imaginary wall which I do not understand how is that possible.
Find attached a video with the mentioned problem.
Could someone help me solve that problem ?
I am including CODE for the ball interaction i.e. changes the direction of the speed of the ball when hits something:
I am facing the weirdest thing I could have expected in my game on the 640x480 VGA.
I am using Spartan-3 board which displays a game on the 640x480 screen monitor via VGA port.
I am using the following horizontal and vertical scan line configuration as per the User Guide of the Manufacturer (XILINX).
scan line: back porch --> Sync Pulse --> Front porch --> Visible area
Horizontally: Back porch = 48 , SyncPulse = 96, Front Porch = 16, Visible area=640.
Vertically: Back porch = 29 , SyncPulse = 2, Front Porch = 10, Visible area=480.
Even though the screen is a bit mis placed because of the placement or length of the porches, the real problem is the ball.
The problem is the ball is hitting some imaginary wall which I do not understand how is that possible.
Find attached a video with the mentioned problem.
Could someone help me solve that problem ?
I am including CODE for the ball interaction i.e. changes the direction of the speed of the ball when hits something:
Code:
process(bordeIZQ_pelota,bordeARRIBA_pelota,bordeARRIBA_raqueta,bordeIZQ_raqueta,velPelota_h,velPelota_v)
begin
velPelota_hNEXT <= velPelota_h;--to avoid “Latch” problem
velPelota_vNEXT <= velPelota_v;
--ball hits upper screen limit
if (bordeARRIBA_pelota <= OFFSET_V) then
velPelota_vNEXT <= velPOS;
--ball hits lower screen limit
elsif (bordeARRIBA_pelota+l >= 479+OFFSET_V) then
velPelota_vNEXT <= velNEG;
--ball hits the Wall (left Green Wall)
elsif (bordeIZQ_pelota <= bordeIZQ_pared + ANCHO_PARED) then
velPelota_hNEXT <= velPOS;
--ball hits the bar (right blue bar)
elsif (bordeIZQ_pelota+l >= bordeIZQ_raqueta) and (bordeIZQ_pelota+l <= bordeIZQ_raqueta+ANCHO_RAQUETA) then
if (bordeARRIBA_pelota >= bordeARRIBA_raqueta) and (bordeARRIBA_pelota+l <= bordeARRIBA_raqueta+LARGO_RAQUETA) then
velPelota_hNEXT <= velNEG;
end if;
end if;
end process;
Attachments
Last edited: