Index of /courses/fall01/cps108/assign/ooga/bejeweled/code
Name Last modified Size Description
Parent Directory -
GameGrid.java 03-Nov-2001 11:14 26K
GridClickAcceptor.java 03-Nov-2001 11:14 457
LinearRealFunction.java 03-Nov-2001 11:14 175
OvershootRealFunctio..> 03-Nov-2001 11:14 378
README 03-Nov-2001 11:14 1.8K
RealFunction.java 03-Nov-2001 11:14 397
SquareRealFunction.java 03-Nov-2001 11:14 181
TaperRealFunction.java 03-Nov-2001 11:14 397
TestFrame.java 03-Nov-2001 11:14 2.9K
doc/ 03-Nov-2001 11:14 -
Greetings from group... whatever our group number is. Anyway, this is our
sliding grid code. Do with it what you will.
Aside from simply moving panels about the grid, it has the ability to move
panels to/from positions outside of the grid (so you can fly stuff in,
out, or past based on extrapolated locations of nonexistent points), the
ability to govern the style of movement (that's what all the
*RealFunction.java things are for), and unlike some other implementations
it does it all without sacrificing the functionality of the GridLayout and
JPanel stuff (such as resizing, and soforth), although it unfortunately
does not allow one to resize in the midst of movement.
While any java.awt.Component can move across, the grid only autodetects
AbstractButton clicks as is.
Files
-----
GameGrid.java the sliding grid
GridClickAcceptor.java an interface for reporting player moves
*RealFunction.java whole mess of stuff for governing movement
TestFrame.java exhibition/demonstration code
Reading the javadoc for GameGrid.java is strongly recommended. Going over
the example code in TestFrame.java is recommended as well. Note the use
of threads; the javadoc for GameGrid goes over why this is necessary.
While threads won't intimidate those of you that have taken 110, others of
you fresh out of 100 may find the whole thing rather confusing. I
apologize for that, and for not finding a smarter way of doing things.
Blame Dr. Astrachan for not being able to tell me how to fork (that is,
copy) threads in Java. ;-)
Oh, one more thing, since someone that apparently thinks I'm stupid asked
(just kidding around) -- the grid does not report clicks while moving.
Also, if you attempt to do moves while it is presently moving, it will
fail. Just a protection measure.
-- Thomas, Jennifer, Lina (aka Bert, Kermit, and Grover)