From f09a089082486a818a8b4443e998757180f68704 Mon Sep 17 00:00:00 2001 From: snsd0805 Date: Sun, 10 Jan 2021 07:56:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FPGA_FINAL.v | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/FPGA_FINAL.v b/FPGA_FINAL.v index e1a431a..6c1c55a 100644 --- a/FPGA_FINAL.v +++ b/FPGA_FINAL.v @@ -184,8 +184,10 @@ module FPGA_FINAL( blockSecond[ball_position] = 0; if(upPosition) upPosition = 0; - else upPosition = 1; - + else begin + horizonPosition = -horizonPosition; + upPosition = 1; + end if(ball_position==0) horizonPosition = 1; if(ball_position==7) horizonPosition = -1; @@ -193,7 +195,20 @@ module FPGA_FINAL( if(upPosition) ball_y_position <= ball_y_position +1; else ball_y_position <= ball_y_position -1; end - + // // 判斷特殊狀態 + if(ball_y_position==7) + if(blockFirst[ball_position]==1) + begin + blockFirst[ball_position] = 0; + + upPosition = 0; + + if(ball_position==0) horizonPosition = 1; + if(ball_position==7) horizonPosition = -1; + + ball_position <= ball_position + horizonPosition; + ball_y_position <= ball_y_position -1; + end end end end