Friday, September 24, 2010

PlayGroundSDK from PlayFirst

I wanted to try out the PlayGround sdk, so went to their website and tried to download it. Sure enough i was prompted to register and create a "Free Account" to download the SDK and the documentation. So like any normal sane person i tried to register.. guess what?.. I couldn't .. why you might ask.. well there was a "CAPTCHA" for making sure that people were registering rather than some bot i guess. So what's the problem you ask?.. I would say THAT is the problem.. why does everybody just use those twisted CAPTCHA which arent' very clear to even read for normal people? Any way i tried it like 50 times... and im' pretty sure i got it right a couple of times but the playfirst's servers refused to accept any of my attempts.. dejected and frustrated i started requesting my friends to try it out and see if they can get one account.. and somehow the audio CAPTCHA seems to have done it for them. For me not so much.. in those 50 times i tried.. (2-3 times was audio CAPTCHA). I guess i just had a very very very bad day.

For what' it's worth.. the SDK seems to be pretty good for like storing / tracking high score data across the world and a clean way to do it with just lua scripts. It's worth looking at even to just learn about the architecture of the framework.

Friday, September 17, 2010

Stardust (HTML5)

I always hated the javascript because of the browser incompatibility issues and so never bothered to do anything much with it other than making a silly menu navigation demo for a tutorial class.

Lately iv'e got interested in the whole WebGL movement with things like mozilla labs starting a gaming initiative and a game dev contest. Later i came across this website and realized i could probably make a resonable 2D game using the canvas element and javascript. Then i came across another gem, a whole freaking 2D game engine built around javascript and html5.

This gave me hope that i would actually be able to make a reasonable game using javascript. And guess what i wanted to port? .. My Pyweek11 entry stardust. I started reading about implementing classes in javascript and a little details here and there and finally go to writing the code. It was quite frustrating at first as some of the things like callbacks didn't quite work as i expected with member fucntions so i ended up using a lot of global variables. Any way i hacked and slashed my way through the random errors i was getting (mostly because i didn't bother to read into the details of javascript docs) and got the game up and running. It was an Interesting experience.
Here are the few Lessons I learnt:
  • Drawing filled shapes using ctx.* functions was more time consuming than just drawing images.
  • The callback functions apparently can't handle scoping well. So no member functions as call backs.
  • For some weird reason assigning a float value to variable and deducting it from another float made it into a NaN. (may be i messed bad but this is what i concluded).
  • Chrome has excellent debugging tools for javascript (breakpoints, profiling, stepin, etc) just amazing.
  • Use firefox to ensure that your code is right. Chrome was somehow ok with some errors in code.FireFox was the only way I could find them.
  • For max browser coverage use ".ogg" files instead of ".wav" for audio in your game/application (chrome doesn't support them).
  • There are extensive set of javascript libraries and tutorials available for just about any problem you might encounter at this stage.
So as you might expect i did run into some performance issues. I reduced/restricted the amount of particles that i created so that it would be good too look at yet have that flair. The blending functionality kinda requires you draw a rect and then the image for effect so i skipped different powerups and made just one powerup to blow all the enemies (this might change though).

Any way you can now.. "LAUNCH GAME" in your browser. enjoy.

Sunday, September 12, 2010

Punish The Player

Looks like people expect the game to "punish" i.e kill the user controlled character or restart a level when they screw up too many times. They want to "see" a loosing condition. I guess that's what brings in the challenge aspect in a game. For my entry in PyWeek11, I went for a smaller simpler game with better game play and it did pay off, I ended up third in the individual entries list . The one thing people complained about was the repetitiveness of the game. I didn't quite get what they meant, because every game does one thing repeatedly.. in a shooter game you shoot, in a puzzle game you solve puzzles. But the major factor for them getting bored was the game didn't quite challenge them.Picking up enemies did effect their score but that was second nature. It didn't effect what they were doing which in turn made the game boring too soon. So I guess it's a good thing to "kill" the user when he/she commits too many mistakes. I think ill' keep this in mind and may be add this to the stardust game as well.

Friday, September 10, 2010


I've never worked on improving any of my pyweek games before. This is the first time im' doing it mostly because i'm not satisfied with what i've put together in the two days i worked during the contest. Any way after a few rounds of feedback, i've added another enemy type to make it a little more interesting. Improved the medal requirements and added the ability to pause the game :D.
Press escape to pause and you will see the pause menu. Once in pause menu, if you press esc again it will quit but if you just click (mouse) then it will resume. Also remember that you can make new patterns using "" available along with the source code. as you can see.. the pause menu is pretty simple and to the point. You can grab the latest executable version from project site

Wednesday, September 01, 2010

pyglet + py2exe

If you want to distribute a python program (game or just plain script) as an exe for windows, there is a nifty library/set of tools called py2exe. This enables you to easily create an exe from your python programs. Here is the list of files you have to ship along with the exe if you are using pyglet library in your program:
package these along with the stuff get in the dist folder and you will be good to go on any windows system :)