chess diagram - making gif pictures moveable

hello, i know very little about javascript and dhtml, but i am learning

i have this simple 'project' making a chess4player diagram where you can examen chess positions

i have this so far (so you get the idea)

what i need is making the pieces moveable, just that, and a reset button so all the pieces are placed at start position

what recommedation/approach do you have, so i can make the pieces moveable?

I am just about to buy thick books about javascript and dhtml

I got the idea from maro's chess javascript


  • Hi,

    There are some ideas of this.
    My suggestion is to do not use the tag because the controling of tables in NN4.0 are very light.
    Position each figure in separate layer (Div,span) what you like. Reason to do this is easy moving of specific choosen figure.
    Above the figures layers placed new layer and capture mousedown event.
    from mouse down you can calculate in which quadrant of board mouse was pressed. If there a figure select if figure is select unselect it.
    Describe each board field as an array never matter if it 1 or two dimensional. from this array you'll check which figure are select and if the place of moving is full. Also you must have another array (better Link list) to describe figures on the board (Using OOP it became very good task).
    This is the common task you must analyze for your problem.
    May be there is a better way for this, but for now that's all.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion