Second, I have a little pet project. This one has not timelines,
and is mainly meant for my own personal growth and javascript
goodness. It is a drag and drop game, and it may not be 100%
possible to do everything I want with it. But that has not stopped
me from trying thus far.
The project: a javascript drag-n-drop chess game.
The goal: Make a chess game that can track movements for players,
make sure moves are valid, remove pieces on capture. I figure
stalemate/checkmate calculations can be left to the players for now.
I've done something quite similar, actually, I made all the pieces
draggables, and all the squares droppables. Then I had loads of class-
attributes with data about the piece (mainly, which square it
originates from and what type it is), and then when you drop it over
something, do the checking if it's a valid move or not.
Thus, each piece was represented with an image, each square was a
div, and I had no array, since the DOM was my collection of how the
board looks. (ok, so that may be a combination of "mechanics" and
looks, but w3c actually says that data about a DOM object should be
collected in the class-attribute as far as I've understood things)
Andreas
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs