From bcdef9aafc02bd8cd5703d353d105e1fc15b0820 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 21 Aug 2014 11:21:01 -0400 Subject: The next piece is now visible under the score --- main.f90 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'main.f90') diff --git a/main.f90 b/main.f90 index 1d31363..b7052bb 100644 --- a/main.f90 +++ b/main.f90 @@ -23,6 +23,8 @@ real(kind=8)::current_time, last_update g%falling = new_piece() g%piece_stuck = .FALSE. + g%waiting = new_piece() + call system_clock(count_rate=count_rate) playing = .TRUE. @@ -30,6 +32,7 @@ real(kind=8)::current_time, last_update last_update = 0 last_score = -1 call draw_score(g) + call draw_next(g) do while(playing) @@ -41,6 +44,8 @@ real(kind=8)::current_time, last_update last_update = current_time call move_piece(g) redraw = .TRUE. + else + !call MilliSleep(50) end if if(g%piece_stuck) then @@ -48,16 +53,19 @@ real(kind=8)::current_time, last_update last_score = g%score call check_rows(g) - new_p = new_piece() - if(.NOT. check_piece(g, new_p, new_p%r, new_p%c)) then + !new_p = new_piece() + if(.NOT. check_piece(g, g%waiting, g%waiting%r, g%waiting%c)) then loser = .TRUE. playing = .FALSE. call clear_keys() exit else - g%falling = new_p + g%falling = g%waiting g%piece_stuck = .FALSE. call clear_keys() + + g%waiting = new_piece() + call draw_next(g) end if end if @@ -126,5 +134,5 @@ contains end do end subroutine clear_keys - + end program fetris \ No newline at end of file -- cgit v1.2.3