...

View Full Version : beginner - game coding



6a6f686e
01-16-2009, 05:07 PM
I am a teacher learning JavaScript in order to design/alter games for my students. One very popular game right now is Bejewelled. Below is a JavaScript of a simplified clone of the game:
bejeweled-game-in-javascript (http://devirtu.com/2008/09/25/bejeweled-game-in-javascript/)
What I want in the end, is for the player to have to match blocks of letters instead of blocks of color. Any suggestions? I would of course keep the credit to the original coder, Anton Teryaev.

Further example for undertsanding:

block soy, block sum, and block suis could be lined up to connect and disappear as if they were the same color in the original game.

Thank you for any ideas and leads as to where to begin.

itsallkizza
01-16-2009, 09:30 PM
The simplest solution is more of a CSS solution.

Concept: Change all background-color (JS backgroundColor) references to background.

How: Change the var colors array values to url()s of images with letters in them. Then go through the Javascript and replace backgroundColor with background.

Pretty easy.

6a6f686e
01-16-2009, 10:01 PM
Awesome - that makes perfect sense.
One more question: how can I have two or more pictures be considered the "same" for the purposes of creating a row? Or can't I?

Another way to look at it: how can two or more var be considered equal or the same for the purposes of actions toward them? Or how would one have blocks of different shades of blue be considered the same var so that if they were to line up, they would meet the requirements to disappear?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum