PreviousUpNext

15.3.630  src/lib/x-kit/tut/badbricks-game/brick-junk.api

## brick-junk.api

# Compiled by:
#     src/lib/x-kit/tut/badbricks-game/badbricks-game-app.lib

# This api is implemented in:
#     src/lib/x-kit/tut/badbricks-game/brick-junk.pkg

stipulate
    package g2d=  geometry2d;                                   # geometry2d    is from   src/lib/std/2d/geometry2d.pkg
    #
    package xc =  xclient;                                      # xclient       is from   src/lib/x-kit/xclient/xclient.pkg
herein

    api Brick_Junk {
        #
        brick_size_high:  Int;
        brick_size_wide:  Int;

        brick_font:  String;

        Difficulty = EASY
                   | NORMAL
                   | HARD
                   | DESPERATE
                   | RIDICULOUS
                   | ABSURD
                   ;

        difficulty_list
            :
            List( Difficulty );

        Range = SHORT | LONG;

        Palette                                                 # This was abstract, but then 'brickview.pkg' wouldn't compile. -- 2009-12-09 CrT
            =
            { brick:            xc::Rgb,
              mark:             xc::Rgb,
              concrete:         xc::Rgb,
              dark_lines:       xc::Rgb,
              light_lines:      xc::Rgb,
              highlight_lines:  xc::Rgb
            };

        difficulty_probability:  Difficulty -> Int;
        difficulty_name:         Difficulty -> String;

        cmp_difficulty:  (Difficulty, Difficulty) -> Int;        # "cmp" may be "compare" here.

        State = NO_BRICK_STATE
              | UNKNOWN_STATE
              | OK_STATE
              | BAD_STATE Int                                   # Number of good brick neighbors.
              ;

        state_val:  State -> Int;

        Position =  g2d::Point;                                 # This was abstract, but then 'brick.pkg' wouldn't compile. -- 2009-12-09 CrT

        west_of     :  Position -> Position;
        northwest_of:  Position -> Position;
        northeast_of:  Position -> Position;
        east_of     :  Position -> Position;
        southeast_of:  Position -> Position;
        southwest_of:  Position -> Position;

        Mse_Evt = DOWN (xc::Mousebutton, Position)
                | UP   (xc::Mousebutton, Position)
                | CANCEL Position
                ;
    };
end;


## COPYRIGHT (c) 1996 AT&T Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext