fix: 改善反彈
This commit is contained in:
parent
309cef8cfa
commit
8d4db76d7a
19
FPGA_FINAL.v
19
FPGA_FINAL.v
@ -110,6 +110,7 @@ module FPGA_FINAL(
|
|||||||
else
|
else
|
||||||
if(ball_y_position>1)
|
if(ball_y_position>1)
|
||||||
ball_y_position <= ball_y_position-1;
|
ball_y_position <= ball_y_position-1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 判斷水平方向
|
// 判斷水平方向
|
||||||
@ -134,7 +135,8 @@ module FPGA_FINAL(
|
|||||||
if(ball_y_position==1)
|
if(ball_y_position==1)
|
||||||
if(ball_position==plat_position)
|
if(ball_position==plat_position)
|
||||||
begin
|
begin
|
||||||
horizonPosition = -1;
|
if(horizonPosition==0) horizonPosition = -1;
|
||||||
|
else ball_y_position <= ball_y_position+1;
|
||||||
upPosition = 1;
|
upPosition = 1;
|
||||||
end
|
end
|
||||||
else if(ball_position==plat_position+1)
|
else if(ball_position==plat_position+1)
|
||||||
@ -143,8 +145,23 @@ module FPGA_FINAL(
|
|||||||
ball_y_position <= ball_y_position+1;
|
ball_y_position <= ball_y_position+1;
|
||||||
end
|
end
|
||||||
else if(ball_position==plat_position+2)
|
else if(ball_position==plat_position+2)
|
||||||
|
begin
|
||||||
|
if(horizonPosition==0) horizonPosition = 1;
|
||||||
|
else ball_y_position <= ball_y_position+1;
|
||||||
|
upPosition = 1;
|
||||||
|
end
|
||||||
|
else if(ball_position==plat_position-1 && horizonPosition==1)
|
||||||
|
begin
|
||||||
|
horizonPosition = -1;
|
||||||
|
//ball_position <= ball_position+1;
|
||||||
|
// ball_y_position <= ball_y_position-1;
|
||||||
|
upPosition = 1;
|
||||||
|
end
|
||||||
|
else if(ball_position==plat_position+3 && horizonPosition==-1)
|
||||||
begin
|
begin
|
||||||
horizonPosition = 1;
|
horizonPosition = 1;
|
||||||
|
//ball_position <= ball_position-1;
|
||||||
|
// ball_y_position <= ball_y_position-1;
|
||||||
upPosition = 1;
|
upPosition = 1;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user