Making web games with DesktopX!

DesktopX lets you use VBScript and Javascript (and any other scripting language that supports Windows scripting host) to extend what DesktopX can do.

But it also allows you to directly access EVERY COM object (ActiveX controls) on your system.

This morning I saw my son playing a game from Lego.com. That got me thinking, wouldn't it be cool if I could take that game and email it to my friends and family who have kids. Not a URL, but the actual game. And what if the final "Game object" was only 2K?

Here's how I did it:

user posted image

Ist, I right clicked on the DX tray icon and chose "new object". It opened up the object props dialog and I chose to create a NEW script. This opened up the DXScript editor and put in the VBScript template code. Since I wanted to make an IE control I went to the script menu item and picked the ActiveX control chooser item.


user posted image

This opens up the ActiveX control list. These are all the ActiveX controls on my computer. Most people have no idea what ActiveX controls are nor do they realize just how much of them on their system. Basically, most modern programs are no longer monolithic. They are instead broken up into COM objects. DesktopX lets you directly access them. I went down and found the Microsoft web browser object and chose that.


user posted image

Now, I don't know VBscript at all. All I know is that ActiveX controls are referred to as well "Controls". Thankfully, DesktopX's script editor has intellisense. So I typed Control. and then intellisense showed all the methods of the IE control. I went through it until I found one that looked like it would let me navigate to a particular page (navigate2). I'd never have known what the method was without this as I haven't messed with COM myself. So Picked that one.


user posted image

Then I put in the URL page from the Lego site my kid was playing on.


user posted image

I exited out of it. There is no "save" option because it's all "live". I right clicked on the object and chose "enable script" to get it started. I held down the Ctrl key to resize the object to be the size I wanted it to be.


user posted image

And voila, my game is on the desktop. Only thing left to do is create some pretty bitmaps to act as the borders of this "window" and then group them together (drag select all the objects and choose to group them). Then I can email it to anyone running DesktopX and they now can play this game.



3,249 views 6 replies
Reply #1 Top
Wouldn't it be easier to email them the URL? But I know what you mean. It's incredible how powerful Desktop X 2 is, especially compared to Desktop X 1. BIIIG difference! And a very good one, too. Thanks for showing us how to do this.
Reply #2 Top

If all you're going to have is the game itself, then yea. The URL is better.

But put a nice "skinned" border around this object with additional options, promotions, related games, etc. and you can start to see where this becomes quite useful.

Reply #3 Top

I'm not sure I understand.
Didn't all of this just put a web browser page on your desktop? Didn't DesktopX 1 already could do that?
I had PHP calendar running through my local PHP server set as a DX object with version 1. How is this different?

I got a question for you though. I have this little weather thingy in Flash (got it from a web site). Since Flash in an Active X control, can I put it directly on my web page with the Flash control, not with the IE control? I found a control in the list called "Macromedia Flash Factory Object". It's the closest thing I found to anything "Flash". But when I select it, it has no properties. I can't find a way to give it a path or a URL. Help?

Reply #4 Top
Never mind the last part of the above post. I was using the wrong control. I found another one called "Shockwave Flash Control", and that's the one and it works! I now have my local weather in an animated Flash object on my desktop. Cool.
Reply #5 Top
Kind of makes those skinnable web browsers seem a litlte less impressive. With DX, you could create your own skinnable web browser in minutes.
Reply #6 Top
I agree with paxx, though it looks easier to do in DX2 than DX. We could aways do this with DX. I haven't really explored it myself, but I had ideas like this one on the draft board for a while (Space Invaders )

I think in a few months, DX will rule the Desktop scene; but that is just my opinion.