From 8d4db76d7a1bb431ec3ff66d35e1c717ff843717 Mon Sep 17 00:00:00 2001 From: snsd0805 Date: Sun, 10 Jan 2021 06:23:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B9=E5=96=84=E5=8F=8D=E5=BD=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FPGA_FINAL.v | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/FPGA_FINAL.v b/FPGA_FINAL.v index bae23d5..2e91664 100644 --- a/FPGA_FINAL.v +++ b/FPGA_FINAL.v @@ -110,6 +110,7 @@ module FPGA_FINAL( else if(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_position==plat_position) begin - horizonPosition = -1; + if(horizonPosition==0) horizonPosition = -1; + else ball_y_position <= ball_y_position+1; upPosition = 1; end else if(ball_position==plat_position+1) @@ -143,8 +145,23 @@ module FPGA_FINAL( ball_y_position <= ball_y_position+1; end 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 horizonPosition = 1; + //ball_position <= ball_position-1; + // ball_y_position <= ball_y_position-1; upPosition = 1; end else