Hey all,
First, I just want to say thanks to all of you who read, and email here frequently.  So "Thanks".

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.

What do I have done?  Not a ton.  I got stuck.  Which is why I need you all.  
What is my problem(s)?  Simply, events.  I think I need to use a lot of event listeners to handle this well, but there does not appear to be a ton of doc on draggable/dropable events, and how to use them.  I understand onDrop, but I really really need a form of onPickUp event.  Does anything like this exist?  Is there any good documentation on events/eventListeners?  I understand the concept (and I am using the onDrop event in the demo thingy below) I just do not know which events are available, etc?
I think the general idea is to do this flow:
Make a _javascript_ map of the pieces (multi-dimensional array?)
Make the active players pieces draggable
When a piece is picked-up:
Call a function to calculate valid movements/captures
Make the dropable squares dropable
When a piece is dropped on a dropable:
Note the movement in the movement log
Update the piece map
Capture the piece (if one is captured)
Switch active player
Go back to "Make the active players pieces draggable"

Can I see what you have done now?  Sure.  Please do not complain about ugly code yet...  I would not even call this a release: 
FYI: The icons are from free delivery at iconbuffet.com (a set named Dresden Tournament).  They give the set away, so I think to help support those guys, I will not bundle the images (at least at this point).

Alright enough of my ramblings...  As always, any help would be appreciated.  If you can not help, no worries, I'll keep messing around.

-Greg
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to