diff options
| author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-08-21 11:21:01 -0400 |
|---|---|---|
| committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-08-21 11:21:01 -0400 |
| commit | bcdef9aafc02bd8cd5703d353d105e1fc15b0820 (patch) | |
| tree | a3f26e87448b0b397e3e36c5067c2457057345e5 /main.f90 | |
| parent | cfbab1a4d15174c88e538eb18cfaf43650442319 (diff) | |
| download | fetris-bcdef9aafc02bd8cd5703d353d105e1fc15b0820.tar.gz fetris-bcdef9aafc02bd8cd5703d353d105e1fc15b0820.zip | |
Diffstat (limited to 'main.f90')
| -rw-r--r-- | main.f90 | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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 |
