Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    beginner - game coding

    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
    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.

  • #2
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    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.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • Users who have thanked itsallkizza for this post:

    6a6f686e (01-16-2009)

  • #3
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •