Tetris was the topic of one of my SUGI 30 papers.
Tired of being productive ? The classic time waster: Tetris
To play, install from this topics downloads and issue this command in the command box:
or submit this stub:
DM "AFA C=GAMES.TETRIS.PLAY.FRAME" AFA;
- Press a number key instead of S to start at a higher level.
- Press Q key to start over.
- You can wiggle a piece after is has been dropped.
- You score only when a row is completed.
More rows get more points. 1:40, 2:100, 3:300, 4:1200
Points are multiplied by level+1.
The multiplier is increased when you eliminate bonus blocks.
- A level is completed when you clear 10 rows.
Each level speeds up, up to level 10.
- The play field adapts itself to the size of your SAS session, but will not resize if you change the size of the initial window. Looks best on 1280x1024+.
- High scores are stored in sasuser.scores.tetris.slist
Programmer hints: The block images were created with DSGI, the images are displayed using Image Viewer Controls and get moved around. The
event() function is checked every 10ms inside a timing delay loop. The delay loop controls how fast the blocks drop.
The application is one frame, four classes and one scl for a method override. ~1,400 lines of well formatted and spaced code.
Todo: Piece on deck preview (for 20% reduction in scoring).
Dream on: Background images. Oh, and DEATH MATCHES (that's a joke)
Thanks: Nigel, Venita, Randy, Rob, Paul, Lynn and Adam. For testing and otherwise providing feedback.
Copyright 2004 Richard A. DeVenezia This page was last updated 17 August 2004.