A closer look at the Zoom View

tutgfx6.jpg (146614 bytes)

Well, I changed the "look" again!  A couple weeks ago I was thinking: "All those little dots moving around are kind of boring, wouldn't it be nice if there was a Zoom feature that could get a close look at a particular part of the screen...".  Well, to accommodate this idea, I ended up cutting the playfield in half, making a new set of gfx to use, and a bunch of research concerning the GDI32 library.  I've seen the syntax to use for the gdi32 stuff (it looks a lot like the DirectDraw stuff actually), but I had never used it in a program.  This library is accessible on all systems, and seems to be the only non-directX way of making this zoom thing work.  Since speed isn't a need for this game, it looks like gdi32 is the way to go.  To get the basic info on this, I went to Timbo's web site (check out my links) and followed his pursuit of displaying game graphics.  After getting the basic BitBlt feature working, I discovered something called "StretchBlt".  This adds the ability to enlarge and reduce - perfect for a zoom view!  One bad thing about adding the zoomview is NO MORE explosions on the full screen view.  A "Snapshot" bitmap is saved to disk each time the game is run to have a picture of the entire background to use with the gdi calls.  If the background is changed - the zoom won't match the actual screen.  One thing I will try is to "update" the background view after each explosion, but I'm not sure I will like this route - it's kinda cheesy.  I >did< try to transfer the image information directly from the Playfield picture, but this resulted in very bizarre resulting images (it was like randomly flipping through images in memory...), so that's why the info is stored in a compatible bmp format to disk before using it.  Now, explosions on the ZoomView ARE possible and even relatively simple (if I have an explosion sequence of frames to use ... I'll have to see what I can whip up).

Two basic additions have been added to the game: 1) a new module called "ZoomModule" and a timer routine in the ControlDisplay form called "ZoomTimer_Timer".  The ZoomModule sets up the needed library calls (which could be transplanted into other apps by the way).  The ZoomTimer puts this technique into action.  After adding  zoom ratio variables to the zoomtimer - the resulting code looks a bit complex, but it's not really.  Just refer to the Rem that identifies the needed values in the "BitBlt" and "StretchBlt" calls.   The "all.bmp" is the file that is used to retrieve the ship and drone graphics:

tutgfx7.jpg (42077 bytes)

There are several tweaks I need to make to the zoom feature (like clicking on the right hand picture and have the zoom move there, and clicking on ships in the zoomview to select them...).  To move the zoom around, just click on the edges of the zoom window to move in each direction.  The "+" and "-" buttons change the area size to zoom in on.

Another change that was made was to be able to adjust the number of computer / human ships to start with.  25 is a bit excessive for a smaller window.   I'll be adding an "Options" window to adjust things like game speed, number of ships on each side (which can be different from each other -  The current default is 10), and things like that...

 

The current project and source code