Why I Refuse to Earn Money From Facebook Games

I was recently approached, through various channels, to co-found a Facebook game.

Essentially the premise of it is to make something like Tetrus or Diamonds and add micro-transactions for bonuses and what not to make the users life on the game easier.

I will get right to the point and state that I turned down the offer.

Sure it is a quick buck, use about 5 hours making the game, £300 of Facebook advertising/marketing and “bingo”, you have something that could earn you double your normal wage in the space of a year. An easy and sustainable income if I may be honest. Once every few years you release a new game and solely you can hold down a wage. No need to work for Zenga or one of those other big companies, just you can earn the money.

So with the last paragraph in mind it seems like a no brain-er to make a Facebook game and earn some easy money, and many do, just look at how many games there are; with an added audience of 1 billion users how can you go wrong? There will always be a suckers addiction and/or misery to feed off.

Wait, what? Addiction and/or misery? Did I really learn to program to do this? And this follows onto my reasoning for refusing to make this game.

Sure I could make this game, sure I could earn a lot of money, but can I really?

Like many others, I learnt to program in my spare time because I wanted to, not to make money. I was in the final year of my university Honors degree in Computing and I had to come up with a final project idea so I chose to make a YouTube replica from PHP. I had never touched PHP before that time nor any web development frankly, aside form a small Java project in my first year to make a simple HTML website running on Tomcat.

To cut to the point: despite doing all that work and still being one of the few in the class who actually completed a project I got a shitty grade; 41.4% in fact which almost failed me (39% would have been a fail) and caused me to lose the 2:1 mark I was heading for.

But that didn’t stop me and I went onto a job which involved that exact work and I can feel pride in my work.

How, after everything I went through to get this expertise and knowledge, could I feel pride in something that feeds on misery? I think I probably speak for quite a few programmers when I say that this isn’t what we learnt to program for.

That’s why I feel sorry for people who work for Zenga, they have to work knowing that they have to take pride in something that brings addiction and misery to many millions of Facebook users, stealing their money in the process; their programs are effectively a plague upon the internet. Maybe that is why I keep hearing such low morale at the company in question, aside from management issues.

Every worth while programmer knows that they need to feel pride for what they have accomplished, sure there will be those who learn to program to “get ahead” in the market or to earn money. But the real programmers, those who make the internet what it is today love to program and they need to feel pride in their work and what they do and know that it is benefiting others, not sucking their money using their misfortunes as an excuse.

I could not feel pride in making a Facebook game that makes a quick buck, though I must admit myself that the thought of doing such a thing is tempting, but for the minute I will resist. I will not convert over to the dark side and become effectively Lord Vader. I still have some moralities left in me.

As such I regretfully but honestly decline to make a Facebook game.


Facebook Dropdown Menu Using jdropdown

Get jdropdown at its GitHub home: https://github.com/Sammaye/jdropdown.

Note: this plugin requires jQuery 1.7.x or higher.

I have made a plugin that can handle dropdown menus from a single anchor. I made this plugin since there was, frankly, no real decent plugins for it. There are plugins for navigation bars, select boxes, option boxes, and many more but none for making a simple menu from a random anchor on your page.

The plugin is called jdropdown, and you can call it on any element (literally) like:

$('.someel').jdropdown({ 'container': 'somecontainer' })

The constructor can take up to 3 parameters:

  • container – This is the jQuery selector (minus the $() around the selector since that’s not actually part of the selector) for the item which the menu items will be put in.
  • orientation – This param tells the script whether to align the menu to the left or right of its anchor and it takes either “left” or “right”.
  • items – This parameter is optional and it is to tell the widget what items will be in the menu. The value is an array of object arrays (i.e. [{//item one}, {//item two}]) and any data can be put into these items but there must be at least a “label” field if your not using your own renderItem function in which case, anything is possible!

The plugin currently has two functions you can override:

  • renderMenu – This basically gives off some HTML for the items to go into the ul
  • renderItem – This works a lot like jQuery UI plugins and it just appends each item to the menu container

Note: If you override the renderMenu function with complex html you may be required to also override the renderItem to append/prepend to the correct element within that menu.

The plugin also has a number of API functions which you can hook into:

  • open – is triggered when the menu opens. This has a $(this) of the anchor which holds all data in the data() function about the menu
  • selectItem – is triggered when an item in the menu is selected. It has a $(this) of the menu item, its parent element holds all information in its data() function about the item
  • close – This is triggered upon close the menu and because of its global scope, has no $(this)

Now, for an example of how to use one of these events:

$(document).on('jdropdown.selectItem', '#fb_menu a', function(e){
    alert('You selected: '+$(this).parent().data('jdropdown.item').label);

    // Do some crazy AJAXy weirdy stuff here to make your app awesome

This function binds to document that when a item in the #fb_menu container is clicked it will run that function.

Final thoughts:

  • As I said, items is optional in the plugin definition. This is because you can actually attach items to the anchors themselves allowing you to have the same styled menu with different options without having to have duplicated code. The simple way of doing this is to add a data-items attribute to your anchor’s HTML and make the value a (valid to: parseJSON Doc) JSON string.
  • Also note the item itself can take ANY data and the jdropdown plugin will just attach that data to the data() of the li for that item allowing you to access it when it is selected. So for example you can place “id” in there or “woop” with values of 3 and access it like: $(this).parent().data('jdropdown.item').id.
  • You must put the container into the HTML page first, best place is at the end of the doc just before the end body tag.
  • You can call this on almost any element so long as you have provided items in some manner.

Have fun! Any questions or if you need clarification just post a comment.