═══ 1. Playing the game ═══ The game Greed is an old Unix classic, and as such is originally a text mode game. This implementation exploits OS/2's Presentation Manager to provide the game with a more aestetic look and adds a few options to the original Unix implementation, but the general idea remains the same. Greed is a board game, where you are presented with a matrix of numbered tiles. Your task is to remove as many tiles as possible. Below is the game board: You control the yellow thing The numbers indicate how many tiles you will move in each direction. You cannot walk over a tile that has already been taken. Nor can you walk off the board. The tiles will be removed in your trail. The depressed tiles around your mark indicate how far you will move in each direction. In the game above, you can move four tiles left, two tiles right or four tiles left/up. You cannot move down since that would take you off the board. You cannot move up, since that tile has already been taken. The game ends when you can't move any further. Use the menus to control the Game settings or to get Help. Your score is shown in the dialog box at the bottom of the game window. Here the score is 17.5%. The other figure is the number of tiles you've managed to remove. This number is not very important - it's the percentage that puts you on the high scores list. You shouldn't expect to get a score of 100% - a score of about 90% is very good. Enjoy! Select one of the following items for further help: Keys help Keys used for playing Greed Game options Setting the game options Getting help. Learn how to get help. Game tips Learn how to get a good score Copyright notice The usual legal stuff as well as some interesting info. Getting the source code How to order the full source code and documentation for Greed. ═══ 2. Keys help ═══ The game is controlled with the keyboard only. Use the arrow keys on the numeric keypad to move. If your keyboard doesn't have a separate number section, these are the keys to use: UP Moves up DOWN Moves down LEFT Moves left RIGHT Moves right HOME Moves up and left PG-UP Moves up and right END Moves down and left PG-DOWN Moves down and left ═══ 3. Game menu. ═══ This menu contains entries for various settings. Select from the list beneath to get more help for: Restart Restart the game. Options Change game options. High scores Display the high scores. Quit Quit game and exit Greed. ═══ 3.1. Restart. ═══ This will restart the game. If you are in a current game, selecting restart will end the game. You use Restart to start a new game or to quit your current game. ═══ 3.2. Options. ═══ Use Options to set the various game parameters. Select Help from the Options dialog to find out more about the individual settings. Select Setting game options to get help for setting the game options ═══ 3.3. High scores. ═══ Select High scores to view the best scores. Greed keeps track of the three best scores from each of three selected game types, as well as the three best scores from the Custom game type. Greed saves the high scores to disk, and the high scores are thus scores for the all time greed champions. ═══ 3.4. Quit. ═══ Select Quit to quit the current game and exit Greed. If you just want to quit the current game, select Restart from the Game menu Quit will save your current game settings. ═══ 4. Help menu. ═══ Use this menu to get help. You can also press F1 at any time to get context-sensitive help. ═══ 5. Setting game options. ═══ From the Options dialog you can set the various game options. In the Grid size section, you select the size of the game grid. You can select from three predefined sizes or select Custom to define your own game size. The game keeps track of high scores for each of the three predefined game sizes as well as for the Custom type. The X-size and Y-size entry fields of the Custom grid size section are greyed out unless Custom has been selected. Select an item below to get information for the individual controls: 20x20 40x30 80x25 Custom X-size Y-size Bitmap options See also Selecting a game size ═══ 5.1. 20x20 ═══ This will select a game size of 20x20. There will be tiles numbered to ═══ 5.2. 40x30 ═══ This will select a game size of 40x30. There will be tiles numbered to ═══ 5.3. 80x25 ═══ This will select a game size of 80x25. There will be tiles numbered to , which is the game size of the original UNIX implementation. ═══ 5.4. Custom game size ═══ This will select custom game size. After selecting custom game size, enter the x and y dimensions in the entry fields. The range of the numbered tiles will depend on the game size - the bigger the game, the greater range. The minimum is -, the maximum is - ═══ 5.5. The X-size entry field ═══ Enter the x-size in this field. ═══ 5.6. The Y-size entry field ═══ Enter the y-size in this field. ═══ 5.7. Bitmap settings. ═══ Greed uses bitmaps to display the tiles. Since bitmaps are device dependent, Greed includes several bitmap sets to match different screen resolutions. Greed will automatically detect your screen device's capabilities and select the bitmaps used for the tiles accordingly. If the current resolution is 1024x768, 8 bits/pixel (256 color) or better, Greed will select the fancy looking 20x20 256 color bitmaps. If the current screen resolution is below 1024x768 or uses less than 8 bits/pixel, Greed will select 16x16 device independent bitmaps for the tiles. You can however tell Greed to override the defaults. Check Always use 16x16 VGA bitmaps to force Greed to use the 16x16 device independent bitmaps. You might want to check this to allow more tiles to fit on the screen, or simply because you find the plain looking 16x16 bitmaps easier to read. Check Always use 20x20 SVGA bitmaps To force Greed to use the 256 colored 20x20 bitmaps. If your device doesn't support 256 colors, this won't look pretty, but Greed leaves the choice to you. This setting is primarily intended for users with <1024x768 256 color displays, who want to enjoy the pretty bitmaps. Check Use default bitmaps to let Greed choose the appropriate bitmaps. This is the recommended setting. ═══ 6. Options dialog - Selecting a game size. ═══ This implementation of Greed allows you to select between three different game sizes (the number of tiles in the x and y dimensions) as well as a custom size. The game remembers the high scores for the four different game types independently. If you select a game size, which won't fit on the screen, Greed automagically puts scroll bars at the border of the game window and puts you in virtual gameboard mode. You can use the scrollbars to move the viewport around the screen, or you can just move close to the border and the window will automatically scroll. Depending on the game size, Greed will automatically decide the range of the numbered tiles. In the 20x20 game size the numbered tiles will go from 1 to 5. In the 80x25 game the numbers will range from 1 to 9 as in the original Unix implementation. The minimum range is 1 to 5, the maximum range is 1 to 9. The game size is selected from the Options dialog in the game menu. The available game sizes are: 20x20 40x30 80x25 Custom size See also: Setting game options ═══ 7. High scores ═══ Check out the High scores window in the game menu for the current high scores for the three predefined game types and for the custom game type. Greed will save the highscores as well as all the settings in its own .ini file called 'greed.ini'. Delete this file if you want to clear the high scores. Though the object of the game is to remove all the tiles, this won't ever happen (unless you select a game size of 1 by 1, that is). In a game size of 80 by 25 for instance, a score of 85-90% is considered very good. When you are done looking at the high scores press the OK button. See also Getting onto the high-score list ═══ 7.1. OK button in high scores dialog. ═══ Press OK when you are done looking. This will bring you back to the game board. See also High scores ═══ 8. Getting a good score ═══ Though getting a good score in Greed requires some amount of luck, practice will also help. Here are some advices to get started: o Try to get to one of the borders as quickly as possible and try to keep the uncovered areas together without too many holes. o Remember that two diagonal lines can cross each other. o Use diagonal lines sparcely, since they will quickly clutter the gameboard. o Don't make long straight lines in the middle of the game board, since they will quickly lead to holes on the board. o Be careful not to press the wrong button - undo isn't implemented yet. ═══ 9. Copyright notice ═══ Greed is freeware, which means you can freely copy it, upload it to any Internet, CompuServe or BBS site and otherwise distribute it by all means. You are in fact strongly encouraged to do so, as long as you don't charge any money for it. It may be included in software collections sold for a nominal fee subject to the following conditions: o The distributed media must include at least 5 software titles for diskette distribution, and at least 50 software titles for CD distribution. o The total price may not exceed US$ 5 for diskette distribution, US$ 50 for CD distribution. Though Greed is freeware, it remains the copyright of Peter Skov Knudsen. It may not be modified in any way, and may not be used for any commercial purpose. Any distribution of this game must include the following files: GREED.EXE The executable GREED.HLP The help file READ.ME Important information. While you are not required to register the game, if you like this game, I would be happy to receive a postcard (preferably) or email. A modest donation will also not be rejected, and will encourage me to make more OS/2 programs in the future. All kind of comments/criticism or bug reports are also welcome. Send postcards/donations to: Peter Skov Knudsen Viktoriagade 8D, 2.tv. 1655 Kbh. V. Denmark Send email to gogol@diku.dk Note - don't send foreign cheques, a few bills in your local currency in the envelope will do ;-) If you send a high density floppy together with a donation of minimum $10, I'll send you the complete source code for Greed. See also: Getting the source code. ═══ 9.1. About greed ═══ Press the OK button to return to the game. Be sure to read the Copyright notice ═══ 10. Getting the source code for Greed. ═══ Are you trying to get started with PM-programming, but find the step from Hello, world to a real program a bit steep? Do you find that all your PM-tutorials end with a but this is beyond the scope of this book once things start to get complicated - exactly where you need the help? Do you have the feeling, that there's a whole bunch of fine and instructive code in the Toolkit samples, but that it lacks documentation? If you can answer yes to these questions, then you might want to order the source code for Greed. Together with the source code (more than 1200 lines of code) you'll get the IPF script for the online help, the RC resource script as well as all the bitmaps and icons used in Greed. But most important, you'll get a INF file ready to view with OS/2's VIEW utility with a thorough explanation of the source code, explanation of the design decisions, and of the general techniques used. These are some of the topics covered: o Working with non-standard windows o Using scroll bars to implement a virtual work space o Keeping track of the update rectangle to allow for fast screen updates. o Subclassing the frame to gain full control of the positioning of the frame's child windows. o Using bitmap animations. o Creating on-line help and documentation and integrating it in the application. o Using INI files to save program information. o And a lot of other useful information. And all this is explained in the context of a full working application. Though it will propably not make you a professional PM developer from one day to another, it will make the gap from hello world to real applications a hell of a lot easier to fill. Furthermore, by ordering the source code, you get the full right to use the entire material for whatever purpose with just one exeption: No Greed implementations, please. To get the source code, send me a floppy disk together with a donation of at minimum US$ 10 (Danish citizens DKK 50, for all others the equal of US$ 10), and I'll send you the source code together with the above-mentioned material. See Copyright information for ordering address and instructions.