0
votes

Javascript: Browser Based Tic Tac Toe Game

posted February 20, 2008 - 11:16pm
Javascript: Browser Based Tic Tac Toe Game

Did you know that you can create online games with Javascript?

You'll likely want to add in some PHP and AJAX for real power, but you can create quite a nifty front-end interface for your game using Javascript.

Using DOM to Manipulate HTML

The major concept you'll need to wrap your mind around is using the DOM to manipulate HTML. Every element on a page - including the text you're reading - has an "object" representation.

Using some well-thought-out Javascript and HTML, we can easily manipulate every piece of a web page through Javascript. You can move blocks around, change, sizes, change background images, handle user input, and much more.

If you're unfamiliar with DOM and Javascript, you may want to head over to this article about resources for learning DOM.

Creating a Game Board - Tic Tac Toe

If you do know a little about JS and DOM - or if you're just brave enough to jump right in - here are two good articles on creating a game interface with JS and DOM.

The first article walks through the concept of a Javascript based game online game. It discusses a bit of the theory - where JS, PHP, AJAX, and DOM fit into the equation. It also provides some code snippets to get you started with developing a game interface.

The second article has more practical results. By the end of that article, you'll have a 100% functioning Javascript-based Tic-Tac-Toe board.

What are you waiting for? Get to learning. Start creating.



Comments

Post new comment

  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text. URLs will automatically be converted to links.
  • Allowed HTML tags: <p> <br> <b> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <span> <object> <param> <embed> <table> <tr> <td> <div>
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Join Xomba Today

Do you like to write? Would you like to make a little extra money on the side? These people do. Join the Xomba community today.
Become a Member