2 Replies - 469 Views - Last Post: 26 July 2014 - 09:50 PM

#1 vwvw  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 23-July 13

Saving the positions of items in a jquery drag drop game

Posted 26 July 2014 - 04:25 AM

Hi

Yesterday I asked how to save a jpeg of the results of drag/drop game. Today I would like to learn about how to save the actual game itself so that when someone opens it, the pieces are in the positions they were saved in.

I am a novice. I've used jquery draggable ui to create the game. I have no idea how to even begin learning how to save the positions.

I would be very grateful for your guidance.

Thanks

Vic
Is This A Good Question/Topic? 0
  • +

Replies To: Saving the positions of items in a jquery drag drop game

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3549
  • View blog
  • Posts: 10,317
  • Joined: 08-June 10

Re: Saving the positions of items in a jquery drag drop game

Posted 26 July 2014 - 07:07 AM

Quote

Today I would like to learn about how to save the actual game itself

without knowing how your game works this is impossible to answer.
Was This Post Helpful? 0
  • +
  • -

#3 Blindman67  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 127
  • View blog
  • Posts: 562
  • Joined: 15-March 14

Re: Saving the positions of items in a jquery drag drop game

Posted 26 July 2014 - 09:50 PM

There are many ways to save the game state. You can save it to a server, via AJAX or with traditional post using a hidden form. You can save it to localStorage via the Javascript storage AP, or if the game is not too complex you can use cookies. You can save it to the users file system (by will need their interaction to do so). You could use a third party plugin (like flash, shudder.....).

Each method has its advantages and disadvantages. The best solution is of course to use several methods there by getting the advantage of all and eliminating the disadvantages incurred by using only one method. So today is the day to learn AJAX, JSON, Forms, Cookies, loaclStorage, WebSQL, Server side scripting, database design, file API's, session tracking, user authentication, and much more. This is what the web is all about, remembering stuff...

If you are into javascript then i would strongly suggest the localStorage API... then if you want users to be able to move from machine to machine learn server side scripting and database design. Should be a good day... :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1