chess diagram - making gif pictures moveable - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

chess diagram - making gif pictures moveable

epikurepikur Posts: 1Member
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


  • borislavborislav Posts: 16Member

    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.