Creation of a Flash arcade site using WordPress


Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2026

Warning: Invalid argument supplied for foreach() in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2026

Warning: Invalid argument supplied for foreach() in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2398

Warning: implode() [function.implode]: Argument must be an array in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3351

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3374

Warning: Invalid argument supplied for foreach() in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3374

Warning: Invalid argument supplied for foreach() in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3415

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3467

Warning: Invalid argument supplied for foreach() in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3467

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3612

Warning: Invalid argument supplied for foreach() in /home/triqui/public_html/emanueleferonato.com/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3612

I am reading for a few days a tutorial about Building a WordPress games arcade on the FingerMonkey Flash Arcade Blog and although I won’t follow his tutorial, I decided I will create my Flash arcade site using WordPress, and once ready it will replace Triqui.com.

Moreover, I will made the WP Arcade capable of updating itself from MochiAds feed.

This first step is only an introduction about what I am going to do in order to have my Flash arcade site using WordPress

Why WordPress?

This is the first question. Let me answer because WP rocks!

It’s stable, robust, always up to date, easy to install, mantain and configure, SEO friendly, free, and fully customizable.

That’s why I am using it… and I will create my own theme starting from the default Kubrick theme.

Why MochiAds?

I am using MochiAds feed because they update it very day, and because more and more developers are using MochiAds to monetize their games.

A quick and easy way to have a Flash arcade site that runs without any interaction from the administrator.

The less time I spend updating the site, the more I earn working on other projects (or the more I enjoy the beach!)

Ok, I’ll use MochiAds feed. JSON or XML?

I am using the JSON one because it’s lighter than XML one (today’s JSON feed is 2.84 MB while the XML one is 6.57 MB).

What’s JSON?

JSON (JavaScript Object Notation) is a lightweight data-interchange format.
It is easy for humans to read and write. It is easy for machines to parse and generate.
It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition – December 1999.

JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.

These properties make JSON an ideal data-interchange language.

Read more information at JSON official site

Now let’s see how a game like Jamag is coded inside MochiAds JSON feed:

1
{"rating": "Everyone", "updated": "2008-07-19", "popularity": null, "description": "Jamag = Just Another Mouse Avoider Game\r\n\r\nBut with something new...", "key_mappings": "", "height": 500, "game_url": "http://www.mochiads.com/games/jamag", "slug": "jamag", "tags": ["mouse", "avoid", "avoider"], "instructions": "Control the red circle with the mouse\r\nCollect purple circles, avoid blue ones\r\nEvery 10 circles collected there will be an explosion\r\nUse it to wipe away blue circles\r\nPress mouse button to activate bullet time\r\nThat's all... it's just another mouse avoider game...", "uuid": "89285254-78b1-3248-9db3-f5ab67ecc542", "author": "Triqui", "control_scheme": "{\"fire\": \"na\", \"jump\": \"na\", \"movement\": \"mouse\"}", "author_link": "http://mochiads.com/community/profile/Triqui", "feed_approval_created": "2008-05-17T14:32:26.644771-08:00", "name": "Jamag", "swf_url": "http://games.mochiads.com/c/g/jamag/jamag_secure.swf", "recommended": false, "thumbnail_url": "http://cdn.mochiads.com/c/g/jamag/_thumb_100x100.jpg", "created": "2008-05-17T12:00:43.262589-08:00", "categories": ["Action", "Other"], "game_tag": "5596fb87fd0f2de1", "leaderboard_enabled": true, "zip_url": "http://cdn.mochiads.com/c/g/jamag.zip", "width": 500}

Let’ see the fields I am going to consider

rating: the rating of the game. It can be “Everyone”, “Teen”, “Mature” or “Adult only”

updated: unix date representing the last update

popularity: the popularity of the game. Seems to be null in every game, even the bloons series, so I won’t consider it

description: the description of the game

key_mappings: keys used to play the game. I won’t consider it

height: the height of the SWF in pixels

game_url: the url of the game, I won’t consider it

slug: the slug of the game, I won’t consider it

tags: the keywords of the game… very important since WP has a native tags support

instructions: instructions how to play the game

uuid: the unique MochiAds id of the game, I won’t consider it

author: the name of the author of the game

control_scheme: how to control the game, I won’t consider it

author_link: the link to MochiAds author page

feed_approval_created: when the game was added for distribution, I won’t consider it

name: the name of the game

swf_url: the url of the swf

recommended: in my opinion is a boolean flag stating if the game is recommended by MochiAds or not, anyway I won’t consider it

thumbnail_url: the url of the 100×100 thumbnail of the game

created: the date of the creation of the game, I won’t consider it

categories: array with the categories of the game

game_tag: it should be another unique id representing the MochiAds code

leaderboard_enabled: boolean stating if the game has leaderboards

zip_url: url of the zip where to download the distribution package

width: the width of the game SWF, in pixels

Let’s parse JSON feed!

Ok, let’s do it. I have good and bad news for you.

Good news is php supports JSON decoding from version 5.2.0, bad news is php supports JSON decoding only from version 5.2.0

That’s all at the moment… in next step we’ll see how to populate a WP blog with MochiAds feed.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (49 votes, average: 4.45 out of 5)
Loading ... Loading ...
WordPress themes are designs for WordPress - one of the most popular blogging software nowadays.
You will be pleasantly surprised by WordPress Themes provided by Template Monster. All of them are of professional design and high quality.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 27 comments

  1. Skofo

    on July 20, 2008 at 6:47 pm

    Nice.

  2. Michael

    on July 20, 2008 at 9:24 pm

    Interesting idea. WordPress does seem the best choice for making an arcade system when you think about it. :)

    Even though PHP only ‘officially’ decodes JSON as of 5.2 and up, doesn’t mean other people haven’t made classes and functions for earlier versions to do the same thing. ;)

  3. Xodus

    on July 21, 2008 at 4:45 am

    well, i dont really know about any of this, but im sure its a good job and i hope that the site turns out nice.
    __
    | [|
    | |
    _____/ |
    (__ |
    (___ |
    (__ /
    (______/

  4. Xodus

    on July 21, 2008 at 4:47 am

    NOO, what happened 2 my drawing?!?

    oh well….

  5. Ada

    on July 21, 2008 at 6:23 am

    Emanuele,

    Great project you have going on here! I am excited to read more about it as you put the site together. If you need ever any support or questions from MochiAds, you know how to reach me. =)

    Ada

  6. Makzan

    on July 21, 2008 at 11:04 am

    Thank you Emanuele, I am looking forward to the next part of the post.

    Great!

  7. Useful information about WP powered arcade sites : Emanuele Feronato - italian geek and PROgrammer

    on July 21, 2008 at 5:05 pm

    [...] I started my project called Creation of a Flash arcade site using WordPress and today I received a lot of emails from readers that want to run their own WP [...]

  8. Web-Game Magazine - the best free action/adventure web games and casual games, reviewed daily » Blog Archive » Useful information about WP powered arcade sites

    on July 22, 2008 at 8:19 pm

    [...] I started my project called Creation of a Flash arcade site using WordPress and today I received a lot of emails from readers that want to run their own WP [...]

  9. Creation of a Flash arcade site using WordPress - step 2 : Emanuele Feronato - italian geek and PROgrammer

    on July 27, 2008 at 3:01 pm

    [...] code has been already explained in step 1, so let’s jump directly to the post I am [...]

  10. Link Post Sunday 07/27 | Mr Sun Studios

    on July 27, 2008 at 4:08 pm

    [...] Feronato made a couple of posts about making a flash arcade site in WordPress. He gives some useful information on it and just released a 2nd part [...]

  11. Link Post Sunday 07/27 | Mr Sun Studios

    on July 27, 2008 at 4:08 pm

    [...] Feronato made a couple of posts about making a flash arcade site in WordPress. He gives some useful information on it and just released a 2nd part [...]

  12. Vernon Laz

    on August 2, 2008 at 10:13 am

    Nice attempt at explaining the ins and outs of creating a WordPress arcade. Although I have to say that FingerMonkey’s outline was far better written, that guy could write like a mofo, your tutorial lacks fluidity and is pretty boring to be honest. What you need is a combination of both.

  13. Parsing MochiAds feed in a friendly way : Emanuele Feronato

    on August 29, 2008 at 12:03 am

    [...] made this little script to debug my portal script (almost completed) and I want to share it with [...]

  14. 10 tips to help you choosing the right hosting plan for your blog/arcade site : Emanuele Feronato

    on August 31, 2008 at 10:20 pm

    [...] While only time (and traffic) will say if your hosting plan can handle enough work, you should at least be able to run the script published in Parsing MochiAds feed in a friendly way or you won’t be able to have your WordPress arcade site. [...]

  15. MochiLand » Blog Archive » Create a Flash Game Arcade Using Wordpress

    on September 25, 2008 at 8:58 pm

    [...] Feronato created one using a feed of MochiAds games. He walks through the process in detail here. He credits Fingermonkey’s experience in building one as his source of [...]

  16. Triqui.com WordPress arcade now in beta : Emanuele Feronato

    on September 28, 2008 at 2:37 pm

    [...] you followed the Creation of a Flash arcade site using WordPress series you know I am about to release a WP Arcade theme with automatic game submission thanks to a [...]

  17. Otras formas de utilizar WordPress « Helektron.com

    on October 4, 2008 at 9:08 am

    [...] para crear un sitio de juegos [...]

  18. Hacer un sitio con Arcades sobre WordPress | Summarg

    on May 23, 2009 at 2:37 am

    [...] Creation of a Flash arcade site using WordPress - Step 1: Explica el porqué de la elección de WordPress y MochiAds, así como las diferencias entre importar desde el feed XML y el JSON. Nos muestra los campos que vienen dentro del feed JSON y cuales vamos a utilizar. [...]

  19. eaonflux

    on May 28, 2009 at 3:07 pm

    Hi all,

    i am in the making of an mochi aracde wordpress site.
    check out mine demo site http://adult-links.info

    p.s. no its not a p&^rn site;)

  20. Al

    on September 5, 2009 at 12:11 am

    Hello my description tag is not displaying any values and does not even close the li. I think it began happening after I installed the All in one SEO plugin. I did uninstall it but it has not changed anything back. Please help.

  21. Al

    on September 5, 2009 at 12:14 am

    My post ratings plugin is also not working. Is there any knowledgebase about this?

  22. opeltnela

    on September 5, 2009 at 1:04 pm

    Thanks!

  23. Juegos Flash: formas de crear tu propio sitio de juegos, Carrero

    on October 20, 2009 at 9:01 am

    [...] Creación de un sitio web de juegos flash utilizando WordPress. vía: Emanuele Feronato [...]

  24. scotttswan

    on October 23, 2009 at 3:41 am

    @AL you need to add at the end of your footer.php

  25. john

    on March 31, 2010 at 3:02 am

    my right-sidebar (like the latest scores, top rated games, most played games and archives) does not work and display empty space. Please help. Thanks.

  26. Porter

    on April 6, 2010 at 7:50 am

    Nice post. I’m starting to pick up PHP and other web programming languages now. I recently bought a new domain, and I’m going to experiment with a new wordpress arcade site myself. I’m going to follow your posts and see what I can learn, but attempt to do it from scratch as well. Thanks for sharing what you’ve learned, it’ll be helpful for sure.

  27. huhu

    on May 29, 2010 at 2:36 am

    Feronato made a couple of posts about making a flash arcade site in WordPress.