Spruuids: Sprite Game for Sample ActiveX VB Scripting Host

Click to open or copy the files for the Spruuids sample.

This sample is a sample ActiveX Scripting host, which hosts VB Script.

This sample includes the following main files:

File Description
ActivScp.h ActiveX scripting header file, used by Game.cpp
App.cpp Implements Main App window via a dialog. CApp is responsible for creating the CMsgLoop object, and CGame object.
CompMgr.h Component Manager interfaces, used by App.cpp and MsgLoop.cpp
DispIDs.h Defines the DISPIDs used for events.
Game.cpp Orchestrates the show, responsible for creating and coordinating CScore, CDisplay (from Spr.cpp), and CSpriteClass's. Handles high-level game behaviors, such as starting and ending games, the menus, and creating, loading, and managing VB Script through ActiveX scripting.
GameOA.cpp OLE Automation implementation for "Game" object in object model.
Guids.cpp Simple file to get all necessary GUIDs to the linker.
Helpers.h Implements some obligatory ANSI/Unicode helpers.
Main.h Main include file included by everyone.
MsgLoop.cpp Implements EXE's message loop via IOleComponentManager. CApp acts as a client to the ComponentManager, implementing IOleComponent.
OleAuto.cpp Small framework for creating OLE Automation objects which have dual interfaces.
Score.cpp Tracks score, level, and number of ships left.
Spr.cpp Core "sprite" engine. Implements CDisplay, CSpriteClass, and CSprite. CDisplay implements the display surface on which the sprites are drawn, and handles drawing the sprites, updating their positions on timer ticks, and tracking collisions between the sprites. CSpriteClass implements a set of functionality shared between common kinds of sprites, such as the starting image used, how sprites of this class interact with the border, etc. CSprite implements a "sprite" which is basically a repository for position, velocity, image, etc.
SprOA.cpp Implements the "SpriteClass" and "Sprite" OLE Automation interfaces for the CSpriteClass and CSprite classes, respectively.
SpruuidP.h Helper file that tells the sprite engine about the graphics found within the main sprite bitmap, Spruuids.bmp.
Spruuids.odl Declares the object model for the Spruuids.exe application.
VBSGuids.h Defines CLSID for VB Script, used by Game.cpp.

Building SDK Samples

This sample uses the following keywords:

_erase; _fdraw; _link; _stat; _unlink; _wcsicmp; aboutdlgproc; addfuncdesc; addimpltype; addnameditem; addpix; addpixlast; addref; addreftypeinfo; addtypelib; appdlgproc; appevt_dlgproc; appevt_fqueryterminate; appevt_newgame; appevt_pause; appevt_pswndproc; argsz; assert; beginpaint; bitblt; buildtypeinfo; capp; causepause; cdisplay; cgame; cgameoa; check; check_pointer; check_signature; checkcl; checkos; checksz; checktypeinfo; clienttoscreen; closegame; clsidfromstring; cmsgloop; cocreateguid; cocreateinstance; coinitialize; couninitialize; create; createapp; createbrushindirect; createcompatiblebitmap; createcompatibledc; createdialog; creategame; createscore; createscriptengine; createtypeinfo; createtypelib; cscore; csprite; cspriteclass; declare_interface_; declare_signature; declare_standard_dispatch; define_guid; defwindowproc; deletedc; deleteobject; destroy_signature; destroyall; destroywindow; dialogbox; dialogboxparam; dispatchmessage; displayassert; displayscripterror; dlgproc; doidle; doidleprocessing; domoveat; drawedge; drawicon; drawtext; enablewindow; enddialog; endpaint; exit; fail; failed; fclose; fcontinuemessageloop; fdoidle; feof; findtoken; fireborder; firecollide; fireinit; firekeydown; firekeypress; firekeyup; firelastterm; firemousedown; firemousemove; firemouseup; firenewgame; firenewlevel; firenewship; fireterm; firetick; fixed; floatoffull; foncomponentexitstate; fopen; fpretranslatemessage; fpushmessageloop; fqueryterminate; fread; fregistercomponent; frevokecomponent; fulloffloat; fwrite; gameover; getbuffer; getclassinfo; getclientrect; getcship; getdc; getdispatch; getdlgitem; getexceptioninfo; getidsofnames; getinfoofindex; getlevel; getmodulefilename; getmultitypeinfocount; getobject; getprimary; getreftypeinfo; getreftypeofimpltype; getscore; getsize; getsourcelinetext; getsourceposition; getstockobject; getsystemmetrics; gettinfoclsaddr; gettinfointaddr; gettypeattr; gettypeinfo; gettypeinfocount; gettypeinfoofguid; gettypelibinfo; getunknown; getwindowrect; getwindowtext; getwindowtextlength; ignoremove; inflaterect; init_signature; initnew; invalidaterect; invoke; invokeevent; is_extender_dispid; isbadwriteptr; isdialogmessage; isiconic; killtimer; layout; loadbitmap; loadcursor; loadgame; loadicon; loadregtypelib; loadtypeinfo; loadtypelib; lstrlen; lstrlenw; mainmsgloop; make_ansiptr_fromwide; make_wideptr_fromansi; makeintresource; makelparam; markfree; memcpy; memset; messagebox; messageloop; movebyfull; movetofull; movewindow; multibytetowidechar; myrand; newgame; newlevel; nextlevel; normalize_i4; oncomponentactivate; oncomponententerstate; paint; parsecmdline; parsefile; parsescripttext; patblt; pause; peekmessage; pgameoa; playback; postquitmessage; processmessage; psprmutate; pswndproc; pumpmessage; puserderef; queryinterface; rand; record; refresh; registerclass; release; releasecapture; releaseptr; releaseptrtype; releasetypeattr; remove; scofcp; screentoclient; selectobject; senddlgitemmessage; sendmessage; setbackcolor; setbaseobject; setbkmode; setcship; seterrorinfo; setfocus; setfuncandparamnames; setguid; setimpltypeflags; setlcid; setlevel; setname; setscore; setscriptsite; setscriptstate; setstatustext; settimer; setversion; setwindowtext; shipkilled; showwindow; size; skipwhite; spriteofi; srand; stdmethod; stdmethod_; stdmethodimp_; strncmp; succeeded; switch; sysallocstringlen; sysfreestring; tempbuffer; terminate; tickofsec; timer; translateaccelerator; translatemessage; unicode_from_ansi; variantclear; variantcopy; variantinit; waitmessage; warning; wcscmp; widechartomultibyte; winexec; wsprintf; xcp