I´m trying to develop a puzzle game. Like the one you find here
http://github.com/madrobby/scriptaculous/wikis/puzzle-demo

My problem is that i want to show the user the correct position off
all images at first. And after 1 second i will reorder them with
Effect.Move(); This i have solved. But when i make them sortable with
Sortable.create(). The imges tend to jump around like they want. And
dont folow the mouse att all when you drop them.

The code i have to shuffle the images is:
shuffleImages: function () {
        var position = [$H({ top: 266, left: 399 }),
                                        $H({ top: 266, left: 0 }),
                                        $H({ top: 133, left: -266 }),
                                        $H({ top: 266, left: -399 }),
                                        $H({ top: -133, left: 266 }),
                                        $H({ top: 0, left: 133 }),
                                        $H({ top: 0, left: -133 }),
                                        $H({ top: 133, left: -133 }),
                                        $H({ top: -266, left: 399 }),
                                        $H({ top: -266, left: 0 }),
                                        $H({ top: -133, left: 133 }),
                                        $H({ top: -266, left: -399 })];
        var makeSortable = this.makeSortable.bind(this);
        this.puzzle.select('img').each(function(e, i) {
                new Effect.Move(e, { x: position[i].get('left'), y:
position[i].get('top'), mode: 'relative', duration: 1, delay: 1,
afterFinish: makeSortable })
        });
}

And to make them sortable i have this;
makeSortable: function () {
        Sortable.create('puzzle_' + this.elementName, {
                tag: 'img',
                overlap: 'horizontal',
                constraint: false,
                onUpdate: this.onUpdate.bind(this)
        });
},

If you dont understand my bad English i have a demo here:
http://web.telia.com/~u44002360/puzzle/

I hope some one can help me

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to