Piece Derived Type

type, public, extends(Field) :: Piece


Contents


Components

TypeVisibility AttributesNameInitial
real, public :: move_time =0.5
integer(kind=c_int), public :: sleep_incr =50
real, public :: difffact =1.
integer, public :: level =1
real, public :: diffinc =1.2
integer, public :: score =0
integer, public :: Nblock =0
integer, public :: Ncleared =0
integer, public :: lines_per_level =10
integer, public :: bonus(-1:4) =[-100, 0, 40, 100, 300, 1200]
character(len=1), public :: blockseq(10000) =""
integer, public :: toc
integer, public :: tic
integer, public :: H
integer, public :: W
integer, public :: x0
integer, public, allocatable:: screen(:,:)
logical, public :: debug =.false.
integer, public :: udbg
logical, public :: newhit =.false.
logical, public :: cheat =.false.
logical, public :: AI
character, public :: btype
character(len=80), public :: why
character, public :: ch(12)
integer, public :: Nx
integer, public :: Ny
integer, public :: x
integer, public :: y
integer, public, allocatable:: values(:,:)
logical, public :: landed
logical, public :: movereq

Type-Bound Procedures

procedure, public :: clear_lines

  • private subroutine clear_lines(self)

    Arguments

    Type IntentOptional AttributesName
    class(Field), intent(inout) :: self

procedure, public :: levelup

  • private subroutine levelup(self)

    Arguments

    Type IntentOptional AttributesName
    class(Field), intent(inout) :: self

procedure, public :: setup

  • private subroutine setup(self, W, H, x0, AI, difffact, debug)

    Arguments

    Type IntentOptional AttributesName
    class(Field), intent(inout) :: self
    integer, intent(in) :: W
    integer, intent(in) :: H
    integer, intent(in), optional :: x0
    logical, intent(in), optional :: AI
    real, intent(in), optional :: difffact
    logical, intent(in), optional :: debug

procedure, public :: horizflip

  • private subroutine horizflip(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

procedure, public :: vertflip

  • private subroutine vertflip(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

procedure, public :: spawn_block

  • private subroutine spawn_block(self, F, NP)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self
    class(Field), intent(inout) :: F
    class(Piece), intent(inout), optional :: NP

procedure, public :: dissolver

  • private subroutine dissolver(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

procedure, public :: move_down

  • private recursive subroutine move_down(self, slam)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self
    logical, intent(in), optional :: slam

procedure, public :: rotate

  • private subroutine rotate(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

procedure, public :: move_left

  • private subroutine move_left(self, slam)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self
    logical, intent(in), optional :: slam

procedure, public :: move_right

  • private subroutine move_right(self, slam)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self
    logical, intent(in), optional :: slam

procedure, public :: check_collision

  • private function check_collision(self) result(collided)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

    Return Value logical

procedure, public :: init => init_block

  • private subroutine init_block(self, F, btype, x, y)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self
    class(Field), intent(in) :: F
    character, intent(in), optional :: btype
    integer, intent(in), optional :: x
    integer, intent(in), optional :: y

procedure, private :: hit_block

  • private function hit_block(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

    Return Value logical

procedure, private :: hit_floor

  • private function hit_floor(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

    Return Value logical

procedure, private :: hit_horiz

  • private function hit_horiz(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(inout) :: self

    Return Value logical

procedure, private :: tell_why

  • private subroutine tell_why(self, msg)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(in) :: self
    character(len=*), intent(in), optional :: msg

procedure, private :: randomx

  • private function randomx(self)

    Arguments

    Type IntentOptional AttributesName
    class(Piece), intent(in) :: self

    Return Value integer