Making Your Website Fun with Games | HTML Goodies

Making Your Website Fun with Games

Written By
Curtis Dicken
Curtis Dicken
Aug 9, 2011
6 minute read

Everywhere you look you find games, games and more games. They are on your cell phone, connected to your TV via a gaming console and everywhere you look on the web. People love their games, even the corny ones.

So, why not attract new visitors or keep visitors coming back with some games on your website? It’s not as hard as you might think. There are basically three methods that you can use to add some gaming fun to your website. And depending on how much effort you want to put forth, the games can be as elaborate or as simple as you like.

Write Your Own Simple Game in JavaScript

It doesn’t take much effort come up with a simple JavaScript driven game. I put together the trivia game code example below in about an hour. It took me much more than an hour to come up with the questions, though. The game is a simple true/false trivia game about the history of video games. I didn’t use any fancy image graphics although I would suggest doing so if you decide to really use this example on a website. Here’s the HTML code:

   

        Video Game Trivia

       

        Asking question 1 of 10 with 0 answers correct

   

        ???

   

   

         

        True

           

        False

   

   

       

   

 

   

You could expand the example above to multiple choice answers instead of just true/false by changing the script a bit and extending the array. You could also make it more interesting with some background colors, graphics, sounds, etc. You are not going to be making the next Space Invaders with JavaScript but you can make some interesting little text-based games with not much effort. Just remember to keep the game fresh by changing up your questions periodically.

Put Free Third Party Games on Your Website

There are several different websites now that specialize in providing free games that you can include on your own website. Most of the free games are fairly simple to play and similar to what you will find in many cell phone game apps. You won’t be playing anything as cool as Halo™ or Mario Bros.™ but many of the games are fun and, most importantly, free.

My two favorite places to download games are Crazy Monkey Games and Free Games Jungle. As with these websites, the vast majority of web-based games are Flash. These sites and others usually zip up the HTML markup that you will need along with the .swf Flash file that is the actual game.

Adding free games offered by other websites is a quick no-cost way to get some gaming fun on your website but you will need to pay careful attention to a few things before downloading. First, be sure to read any licensing and/or terms of use agreements before downloading. Often you will find wording that may restrict use based on commercial versus personal websites, requirements for linking to the site you download the game from, etc. Second, many sites offer free downloads but the games they offer for free have limits built into them like only allowing the first 5 levels to be playable. You will then have to buy the full version to open up the complete game. Of course, that is fine if you love the game but just be aware that “free” is not always what it seems.

Advertisement

Create Your Own Flash Game

If you want to go all out and build your own stellar Flash game for your website then I suggest that you start by playing a variety of other Flash games to get a feel for what works and what doesn’t. Then once you come up with your concept here are a few websites and tools that might help you in your endeavor.

1.   Download Flash Free Trial – If you don’t already have Adobe Flash then I suggest you download the free trial to see if Flash programming is right for you. Programming in Flash is very different from HTML, Javascript, etc., so you may want to try it out before you commit.

2.   Read some Tutorials at Flashkit.com – There are tutorials here for everything from getting started with your first game to the more advanced physics in game development.

3.   Sprites and Textures – Find some textures and sprites to use. There are quite a few sprite & texture sets available to get you into development quickly and many are free. This can be a great time saver, especially in the beginning of your game development. You can always create your own custom sprites and textures later in the project if you like.

Have Fun, Make Fun

Adding games to your website can be fun for your visitors but also for you as a developer as well. After all, someone has to test out all those games before deciding what options are best for your website. Enjoy!

 

HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.