Re: Looking For Some Simple Code
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Dec 02, 1999
- 371 views
David Roach wrote: > Does anyone know where I can get some simple > code for simple games. I've also written a 'Stones' game (clone of 'Same Game') and 'GlassWorks' (clone of 'Stained Glass'). I think the code in them is a bit more readable than those included in Win32Lib. There are some complexities, but at the core they just do some hit testing and screen painting. For most Win32Lib games, it makes sense to double buffer your screen output. That is, draw everything to an off-screen bitmap the size of your play area, and then update the window by drawing the bitmap in the window. The demos in Win32Lib take a more obscure approach to things, and as a result are a lot more difficult to understand and modify. The nice thing about double buffering is all the onPaint() routine has to do draw the bitmap. Also, be sure to take a look at the 'Pretender' demo in Win32Lib - it shows off what you can do with sprites (bitmaps with transparency), something I haven't done in any of the other demos. I had originally written the transparency code so I could drag playing cards with curved corners around in a window. The code is for an outdated version of Win3Lib, but I could send it if you are interested. If you are still interested in card games, you also might want to take a look at: http://wildsau.idv.uni-linz.ac.at/mfx/pysol-cardsets/index.html for a lot of different card sets. -- David Cuny