Chrome Extension: Resolution Test

Evenin,

I was just thinking about creating a background for my Twitter page when I thought it would be useful if there was a chrome extension that would resize your window to mimic different display resolutions. I did a search but I couldn’t find one, so I thought I’d have a go at creating one myself.

I haven’t done a lot of javascript before and its still very rusty, but if you’re running chrome on the dev branch you can install the extension here.

Enjoy :)

-Ben

[Thanks to famfamfam for the icons]

 

This has become incredibly popular!! Over 23,000 users and counting!

Get it here, or at the official extensions site

Current version: 2.0

Changelog:

  • 2.0
    • Added options page
    • Added ability to customise resolution list – add/remove/reorder (as requested by gogogadgetearl, Dima, Kirk, Tomek and many others)
    • Added option to close popup box on window resize (as requested by Famlam)
    • Added option to use desktop notifications
    • Improved design
    • Added 1024 x 600 as standard resolution (as requested by wikiyu)
    • Added 1366 x 768 as standard resolution (as requested by Ben Dickson)
    • Added ‘About’ section on options page with a link to buy me a beer should you be so inclined ;)
  • 1.80
    • Added Google Browser Size support (as requested by Steve)
    • Tidied up look and feel
    • Added icons for tasks
    • Reduced overall width
    • Fixed reset bug where sometimes the width wasn’t recorded correctly
  • 1.70
    • Added reset button (as requested by Kirk, t-dub)
    • Added 1024×600 as standard (as requested by danio)
    • Added checkboxes to open multiple resolutions at once
  • 1.61
    • Fixed large icon not showing up in extensions list
  • 1.6
    • Added new icons
  • 1.5
    • Added 1280 x 800 and 1280 x 1024
  • 1.4
    • Polished UI a bit
    • Auto-updating now works
    • Added custom option to fill in your own resolution

Creating Buttons Quickly and Easily with Actionscript 3

Hey guys, hope you’re all well.

As you know I’ve been working on a flash game recently that is due out soon (I’ll keep you posted) and one of the things I’ve found most over-complicated and time consuming is creating and managing buttons. For example, if we want to create a simple button that runs a function we’d have to write something like this:

   1:  button.addEventListener(MouseEvent.CLICK, someFunction);
   2:  button.buttonMode = true;
   3:  button.mousechildren = false;
   4:   
   5:  function someFunction (e:MouseEvent)
   6:  {
   7:      //button function here
   8:  }


That’s quite a lot for just a simple button, and what if we want a mouse over animation? Then it looks something like this (using Tweener):

   1:  button.addEventListener(MouseEvent.CLICK, someFunction);
   2:  button.buttonMode = true;
   3:  button.mousechildren = false;
   4:   
   5:  button.addEventListener(MouseEvent.MOUSE_OVER, overFunction);
   6:  button.addEventListener(MouseEvent.MOUSE_OUT, outFunction);
   7:   
   8:  function someFunction(e:MouseEvent)
   9:  {
  10:      //button function here
  11:  }
  12:   
  13:  function  overFunction(e:MouseEvent)
  14:  {
  15:      Tweener.addTween(e.currentTarget, {_brightness: 1, time: 0.3, transition: "easeInOutSine"});
  16:  }
  17:   
  18:  function  outFunction(e:MouseEvent)
  19:  {
  20:      Tweener.addTween(e.currentTarget, {_brightness: 0, time: 0.3, transition: "easeInOutSine"});
  21:  }


That’s a lot more already, and this is just for one button with a simple animation!

Then we have the issue of removing event listeners when we don’t need/want them anymore. In AS3 we need to write something like this:

   1:  button.removeEventListener(MouseEvent.CLICK, someFunction);


That might look like a relatively simple one line operation, but baring in mind we have to do this for every listener the button has (click, mouse over, mouse out etc) and we have to already know what listeners are attached and what function they perform, the whole process becomes far too time consuming for something that really shouldn’t be.

I’m not having a go at adobe for making the process convoluted, I agree with the methods used and I wouldn’t want it changed, but to save time I wrote a QuickButtons class to do all this stuff quickly and easily.

To setup the class initially you just put this variable definition:

   1:  public var qb:QuickButtons = new QuickButtons();


Then whenever we want to add a function button anywhere in your code we can just write:

   1:  qb.setupFunctionButton(button, someFunction, true);


Where ‘button’ is the movie clip you want turned into a button, ‘someFunction’ is the function you want it to run and ‘true’ means it will add the default over/out animations (this can be defined at the bottom of the class file).

So that’s nice and simple, but what if we want to do a custom animation for this button? Then we have this:

   1:  qb.setupCustomButton(button, overFunction, outFunction, someFunction, true);


Where ‘button’ is the movie clip you want turned into a button, ‘overFunction’ and ‘outFunction’ are the over/out animation functions, ‘someFunction’ is the function you want it to run and ‘true’ means it will use the hand cursor.

If we want to setup a button that opens a URL we can use:

   1:  qb.setupURLButton(button, "http://someURL.com", "_blank", true);


Where ‘button’ is the movie clip you want turned into a button, the first string is the url you want to link to, the second string is the target frame and ‘true’ means it will add the default over/out animations.

I also wrote a function for text that automatically places a catchment box behind it, it looks similar to the above:

   1:  qb.setupTextURLButton(button, "http://someURL.com", "_blank", true);


There is some more in there too but you can find them in the class once you’ve downloaded it.

We still have one more issue however, what about removing listeners? Unfortunately we don’t have a magical ‘removeAllEventListeners’ function built into flash, but I have written my own one that will work only with events added to buttons by my class. We simply put:

   1:  qb.removeListeners(button);


If you want to see how this works just have a look in the class. In a nutshell it stores all the added events in and array on the button’s movie clip and then removes them one by one.

So, there we have it, the first version of my QuickButtons class. I’ll add to it as I work perhaps but its good enough to save you a lot of time as it is now. You can use it and edit it for anything as much as you like, so long as you keep my name at the top I don’t mind :) Let me know if you need any help with it in the comments, you can download the class here.

Enjoy!

-Ben

Wave Giveaway Results

 

Well the replies started quickly but then fizzled out so all 11 people who entered get an invite!

If you are one the following people please message me your email addresses on Twitter and I’ll send them out:

@c_crampton

@distordz 

@satyadeep_ 

@Rishabh_Singla 

@Fillie86 

@dunwan 

@benfurnival 

@SixSidedSquid 

@philcampbell

@guiapprobato

@Jesse111

Well, that was fun :)

-Ben

Progress & Catholicism

Lo,

Work on the game is going well and as soon as I have a worthy build to show I’ll get it on here, I’m very nearly at the end of the main game mechanics and its actually pretty fun to play :D

Garry (garry.tv) posted a link to this on his Twitter which I watched early this morning and I thought I’d share it with you on here. Its a brilliant argument from Stephen Fry and Christopher Hitchins against the notion that “The Catholic church is a force for good in the world.” Enjoy:

[Edit - Had to remove embedded player as it kept playing automatically, to see it click here

-Ben

Happy November

Hello! I am still alive. Its been ages I know, consider my wrists duly slapped.

Recently I’ve been working a lot and going to the gym so I haven’t had nearly as much free time as I used to, but here I am!

So why am I blogging today? Because today marks the first day I’m being paid to make a game. No, I haven’t gotten a job in the games industry just yet, I’m making a Christmas Flash game for the web within my current job, and its proving rather fun ;)

I think I have about 3 weeks to do it roughly, I might post some progress builds on this blog if I can along the way, here’s one I made earlier:

 

In other news, some mates and I went to the EuroGamer Expo last Saturday, it was sick. Lots of promising games on display, my highlights being: Split/Second, Aliens Vs Predator, New Super Mario Bros. Wii, and of course, Left4Dead 2. In the afternoon we were privileged enough to have a developer’s session with writer Chet Faliszek from Valve who was talking about the Hard Rain campaign in Left4Dead 2. It was really great to get such an in-depth insight into the design of this campaign and to get some of the back story about the Left4Dead world, such as that witches love sugar and are active during the day (this is why they walk around in daylight maps). We also saw scavenge mode which looks to be awesome fun, and he talked about realism mode too – no glows, no alerts, no rescues. The full transcript of the talk is written up here if you want to read, its very interesting.

Also, been playing the Lef4Dead 2 demo, cannot wait for this to come out now, its lining up to be my favourite game of 2009.

Much love,

-Ben

Employment

Wow, I’ve left it over a month, sorry about that!

I do have an excuse however, I got a job :)

No, its not in the games industry yet but it is paying the bills whilst I continue searching. I’m working as a Flash/Actionscript 3 programmer for a web design firm, its fun and challenging work and I’m making stuff I think is cool.

So how are things on the game front? Miserable. I apply for every suitable position on GamesIndustry.biz and I very rarely get so much as a reply.

So the current plan is keep applying, and work on game projects when I can to expand my portfolio. 2 Uni friends and I are gonna start working on something too so that should be fun :)

Been playing Batman: Arkham Asylum which is awesome, love it when a game just comes together. The fighting is smooth and fun, and the story and puzzles are compelling enough to keep you satisfied. I like it a lot.

Also got Scribblenauts on the DS, gotta say its very impressive from a technical standpoint. 20,000+ items reported, that’s a phenominal amount of work! I can’t help but think there’s more potential for it though, the puzzles are sometimes glichy and uninventive and I find that I use the same items a lot, especially the rope and jetpack. Its still awesome though, and often hilarious, go get it.

Watched District 9 tonight, great film, really enjoyed it. Really hoping there’s a sequel planned! I want to know what happens to Christopher!!! Been a while since I’ve seen a decent sci-fi at the cinema. I watched “Knowing” with Nicholas Cage too, that was also great, never saw the end going that way!!

I’ve just decided that I’m going to revisit shootr and add the stuff I wanted to, I feel like I put so much into that game and I owe it some more work :)

Night night,

-Ben

Sad News

Hey readers and Twitter followers and people who read my blog on Facebook but never comment (I know you’re there :P I have statisticals!)

I have some sad news – I am turning my job hunt to Games Testing and Q&A :(
I still of course want to program and design, but finding a job in the industry is proving near impossible for a graduate with no experience and I have applied to loads of companies that haven’t even replied! So, here’s my new plan:

  • Get into Q&A
  • Earn some money
  • Work on projects in my spare time and get more stuff out there + bumlick
  • Get into programming/design
  • Earn money++

Super depressing but my pockets are very, very empty.

In other news I’ve sold lots of stuff on eBay recently to try and make some cash. Got lots of stuff yet to go on but I have learned 2 things about eBay – 1.Its all in the shipping fee and 2.The eBay Turbo Lister is a terrible piece of software, but its still a lot faster than listing things directly on eBay.

Those of you who are android users, I’ve just started using Touchpal as my replacement on-screen keyboard for when I’m walking or whatever and it is really, really good. Switch it to the mode pictured below and you will love it :D – if you’re reading on your phone click here to get it on the market and here for the English language pack.

BTW if you’re a FriendFeed user my blog now supports “PubSubHubbub” so it means as soon as I post it will appear instantaneously (whoa spelt that right first time :P ) in your FriendFeed and other sites when they support it (Google Reader soon apparently).

Still loving SquareSpace, especially their stats and search engine management systems. Apparently if you do a search for “screaming narwhal carla” (see You Fight Like A Dairy Farmer) on Google I’m the 2nd result!! Lmao, that is awesome, hi Monkey Island speculators!

Have a good tenth of August,
Much love,

-Ben

No Experience Required

Been applying for jobs again today on gamesindustry.biz. Its a cool site that makes applying for jobs really simple but out of 140 listings for London and south east England there were only about 15 that didn’t 100% require 2 or more years of experience. Damn its hard to get into the games industry! How am I to gain this fabled experience if all jobs require experience??

I’ve applied to quite a few anyway so we’ll see what happens. Meanwhile some friends and I have formed a small team to build our own game together, its good practice and will look good in our portfolios also, plus hey it could count as “experience”.

We’ve decided on the initial game premise and team name but I don’t want to reveal too much right now. We will have our own site & blog soon enough and we hope to document the game’s progress very early on, by the end we might have an interesting start to finish development story. There are 3 of us at the moment and I hope we will all blog about our challenges and progress as time goes on.

We’ve decided to use the Ogre 3D graphics library for the game so tomorrow I will begin learning that, I’ve gotta say I’m pretty excited! Can’t wait to get back into the coding zone again, hopefully my next post will link to our new team site but we’ll see :P

Night,

-Ben