MozillaZine

More on Mozilla Gaming

Thursday August 10th, 2000

Dave Boswell writes, "Thanks to Dan Haddix PagMan has made an astounding amount of progress lately. Check out the latest version of the game (it works!) here."

Dan has also posted a version with an easter egg here.


#1 Nice

by bradfitz <bradfitz@bradfitz.com>

Thursday August 10th, 2000 8:42 PM

Reply to this message

Very nice .... and quite playable. I expected it to be much slower.

For those that haven't found it, the easter egg is typing "mozillarules".

function enterSpecial(which){ specialString += which; if (specialString.toLowerCase() == "mozillarules") alert("You Have Found The Secret Mozilla Version of PagMan\nHave Fun!"); }

Unfortunately if you make a typo, you'll have to hit reload. They should add something like

if (which=='m') specialString='';

to the top of that function.

#2 Re: Nice

by Anon

Friday August 11th, 2000 3:48 AM

Reply to this message

Thanks for spoiling the fun >:(

hehe :)

#14 Re: Nice

by Dan6992

Friday August 11th, 2000 12:10 PM

Reply to this message

Cheater! I knew the easter egg was going to be visible in the code as that is one of the disadvantages to using a scripting language. As a matter of fact that is why I made the function names so obvious, but did you have to blow it for everyone who didn't want to know?

As for the method I used it isn't as simple to fix as you make it sound. The XUL code I used only calls that function if one of the keys that spells MozillaRules is pressed, so your little piece of code wouldn't do any good. The only way to fix it would be to check the string every time one of the keys was pressed and reject the key if it wasn't the right one for the next letter in the string. However this would have the side effect of allowing someone to randomly start pressing keys on the keyboard and eventually the easter egg would show up.

Dan

#15 Re: Re: Nice

by FrodoB

Friday August 11th, 2000 12:44 PM

Reply to this message

Not necessarily.... Just throw out previously entered characters if one is wrong. :)

#16 Re: Re: Nice

by bradfitz <bradfitz@bradfitz.com>

Friday August 11th, 2000 1:01 PM

Reply to this message

I understood the code just fine.

I just think you should clear the buffer everytime you see the start of the word.... so if you type mozillaulers you can type mozillarules again and have it start over, because the m will clear it.

#3 this is the good stuff

by dash2

Friday August 11th, 2000 4:00 AM

Reply to this message

this really is the sort of thing that AOL users will love. If they can use Netscape 6 to play games, use applications etc. and if there is enough stuff out there. The only question is, can it be made faster? 'Cos if not, you would be tempted just to get a Flash plugin and play Flash games, or Java ones. But if stuff can be got working fast I can see XUL being a really good selling point.

#4 Is Frogger doable? Donkey Kong?

by slam

Friday August 11th, 2000 4:17 AM

Reply to this message

First instinct was to fall back on the old "patterns" ingrained in me from original Pac Man when I was 13. This is more challenging than the original though. Back then, I had to sell candy at school for quarters for the arcade. Don't make games the way they used to.

What's possible here? Seems like anything with not too much movement would be possible.

With Donkey Kong, you could have a really wide table and set the scroll bar positions so the character stayed in the middle of the screen.

Anybody else win? I did, nyah.

#10 Re: Is Frogger doable? Donkey Kong?

by Jake <jake@bugzilla.org>

Friday August 11th, 2000 10:52 AM

Reply to this message

Yep, I won... first try even... and let me say, I'm impressed (not necessarily that I won... :O) I didn't realize the XUL was dynamic enough to do something like that with. I'm impressed both by the tools devoloped by Mozilla and by Dan Haddix's work on PagMan.

#12 Re: Is Frogger doable? Donkey Kong?

by Dan6992

Friday August 11th, 2000 11:28 AM

Reply to this message

As a matter of fact I have also done both a Frogger and a DonkeyKong for Netscape 4.x so I guarantee they can be done in Mozilla. The Frogger game can be found on my site at <http://3wdesigns.simplenet.com/frogger/> The DonkeyKong game was 95% done but it got to the point where it was so slow that it was barley playable on my PII266 so I gave up on it. I think Mozilla may be able to handle it better though since the DOM functions allow me to do the same amount of work with a lot less code then NN4.x required. I am eventually going to port them both, but I don't know how soon.

Dan

#5 Arrgh! Not more screenshots using 'modern'!

by dave532

Friday August 11th, 2000 7:05 AM

Reply to this message

We need to make classic the default skin IMHO, there's even quite a lot of mozilla.org, Netscape people openly agreeing on that. If you agree then vote for bug 48205 <http://bugzilla.mozilla.org/show_bug.cgi?id=48205> The more screenshots of mozilla using the modern them, the more people who are just gonna take a quick look and think it's the most ugly browser ever developed.

We need to make the classic theme the default and the classic widgets the standard (if a skin doesn't supply their own)

#11 Re: Arrgh! Not more screenshots using 'modern'!

by sdm

Friday August 11th, 2000 10:54 AM

Reply to this message

From the comments in that bug, it looks like it will be the default once the remaining bugs are worked out.

#6 Why XUL?

by WillyWonka

Friday August 11th, 2000 8:03 AM

Reply to this message

Why was XUL used to design this game? I think it would be better if you used a standards compliant language such as html+css1+dom1 or xml+css+dom1 that way with little modifications you could also get it to work in IE and Opera.

People are saying how standards compliant mozilla is, yet when they try to make something in it, they use one of its few non-standard commands to do it.

If it were DHTML I think the only difference between IE 5.0 and mozilla's DOM, when following the standards closely (for this particular game) would be when capturing the input events as IE does it wrong. (I've made a DHTML game which works in both IE5 and Mozilla before and this was the only place I needed a browser sniffer)

#7 Re: Why XUL?

by dave532

Friday August 11th, 2000 8:24 AM

Reply to this message

Any chance of a link to this game?

(sig)-- Make Mozilla look better :-)

<http://bugzilla.mozilla.org/show_bug.cgi?id=48205>

#8 Beam Rider 5k

by WillyWonka

Friday August 11th, 2000 9:24 AM

Reply to this message

<http://www.iprimus.ca/~brent/tech/beam/>

I made it for the 5k competition - thats why the graphics are bad. For some reason it doesn't work the first time all the time. Just hit reload and it should work.

Its still slower in Moz than in IE - when they both use the same set timout so in theory they should operate at the same speed.

#9 Beam Rider

by pohl <pohl@screaming.org>

Friday August 11th, 2000 9:56 AM

Reply to this message

That's a fun little game. I'm amazed at how much you squeezed out of the size limit. The shift-key didn't work in M17, unfortunately, so my ship was half-crippled for weaponry, but still had fun. Thanks for sharing!

#19 Re: Beam Rider

by WillyWonka

Friday August 11th, 2000 1:39 PM

Reply to this message

> That's a fun little game.

It's an old coleco vision game I have beside my computer which I like to play every so often. In the coleco version the vertical lines are actually in perspective, but because I had to get it under 5k I made it Ortho view :)

> I'm amazed at how much you squeezed out of the size limit.

It's not that hard.

1. Compact the functions and reuse a lot of code.

2. use 1 character variable names. Remember JavaScript is case sencitive. So n is different from N.

3. Shorten the dom commands. var d = document; var e = d.getElementById; (I didn't do this in all places because of a bug which was around durring the competition... it should be fixed now)

4. Remove all spaces

5. Remove all carrage returns. On windows a carrage return is 2 characters and you can replace it with a ; so you get that down to 1 character.

6. Remove as many ;'s as possible. {a=0;} can be squeezed down to {a=0} because the } is equiv. to a ;

7. Remove english. English words are long... for example, at one point I had Play Again? (Y/N) which I shortened to Retry? (Y)

8. And when you are trying to squeeze every last byte out... use 99px instead of 100px for your coords. It shaves one byte off.

The game that I entered could be shrunken down a lot if I descided to rewrite it, but I didn't want to look at the code anymore.

#13 Re: Why XUL?

by Dan6992

Friday August 11th, 2000 12:00 PM

Reply to this message

I came into the project after the decision to use XUL had been made, but I believe that decision was largely based around the grid widget. It helped considerably speed up development and helped me beef up on my XUL skills. Plus the whole point of this project was developing a game for Mozilla not IE. If you wanted to take a crack at it this game could still be ported to IE with an XML namespace, a little extra CSS and some minor modifications to the JS code.

Dan

#18 Re: Re: Why XUL?

by WillyWonka

Friday August 11th, 2000 1:23 PM

Reply to this message

"I came into the project after the decision to use XUL had been made, but I believe that decision was largely based around the grid widget."

Ah okay

"Plus the whole point of this project was developing a game for Mozilla not IE."

Okay, I can see that, but if you really want to impress people, show them that you can code it once and get it to work in all web browsers. After all, thats what all the fuss about the w3c standards is about.

#17 Speed up!

by westonmr <weston@joyinjesus.com>

Friday August 11th, 2000 1:06 PM

Reply to this message

I too won on the first shot, but it was difficult since I couldn't see PAG-MAN when I was moving! It was very sluggish. We must make Mozilla faster, and soon or people aren't going to give us a shot. And I believe that we can do it!

#20 WoW!

by Tanaaln <olympictram@yahoo.com>

Friday August 11th, 2000 4:35 PM

Reply to this message

Well, I just beat it... and aside from my little mozilla diappearing when he moved too fast... (maybe he was moving so quickly I couldn't see him... ::grin::) it was a cool game. The only other thing, I guess, is that the big circle things that you eat to scare the bad guys off don't regenerate when you play the game again... Anyway, great game! :)

Scott

#21 Re: WoW!

by Dan6992

Sunday August 13th, 2000 11:54 AM

Reply to this message

Doh! I had to write a fix to put the dots back but I forgot about the power ups! I'll fix it up and submit a patch to the gaming group later today.

Dan

#22 Xultris

by mackers

Tuesday August 15th, 2000 2:38 AM

Reply to this message

Hi,

If you're interested, I have made a Tetris-clone in XUL. You can download it from <http://www.xmlw.ie/mozilla/xultris/xultris.zip> You have to install it as a chrome and it only works in M17.