Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 680861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:25:08+00:00 2026-05-14T01:25:08+00:00

Imagine that HTML page is a game surface (see picture). User can have n

  • 0

Imagine that HTML page is a game surface (see picture).
User can have n number of boards (blue divs) on his page. Each board can be moved, re-sized, relabeled, created new and removed.

Inside each board there are m number of figures (purple divs). Each of these user can move inside the board or to another board, re-size, change color and label, delete, add new.
The goal of the game is not important, but let’s say it is to rearrange figures in a certain way so that they disappear.

But the goal of the programmer is to save the whole game surface in the database for every user of the site, and to load it later when he returns.

So, how do I go about data exchange between client and the database?

alt text

Here’s how I think it can be, but maybe there is a better way.
In the database I think of creating tables users, boards and figures.

Then I can SELECT all that belongs to a user and create his HTML page (surface).

But then, user will be able to change all of those properties of boards and figures and I don’t know how to track those changes and how to save them back to the database. Is this a situation where JSON should be used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:25:08+00:00Added an answer on May 14, 2026 at 1:25 am

    I’m assuming this is mostly going on with javascript when they’re playing and that you already know how to do that. Well, each figure has propertes, like this:
    -board (the one it’s in)
    -id
    -label
    -width
    -height
    -color
    -x position (relative to board)
    -y position (relative to board)

    So each of those properties will be held in a javascript variable or array while playing. Likewise, the boards also have properties:
    -id
    -label
    -width
    -height
    -color
    -x position (relative to page)
    -y position (relative to page)
    So you will hold these in javascript variables as well.

    When you save you just need to pass all of those variables over to the server. So make your XHR with your JSON string. Once your server receives the request you translate the JSON back into variables you can stick in the database. The way you’re planning your database sounds appropriate.

    To restore you would just SELECT the appropriate info for that user and (either with a normal page load or XHR) and use your javascript that moves everything around to create and position the objects where they need to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's imagine that I have something like this: <html> ... <div> <iframe src=test.html hash=r4d5f7></iframe>
I think this is a simple question. Imagine you have a page that initializes
Imagine we have a page with a form where users can create their own
Good morning all. Is there any jsf control that escapes the html tags? Imagine
Imagine that I have a nice Deck class, in the best OO fashion. It
Imagine that i have the following code: <a:repeat value=#{bean.getList()} var=x > <li class=la> <span>
imagine that I have a Form with 9 controls (TabbedStuffControl) in a 3x3 tile,
I have come accross the static HTML app for facebook pages that allows us
Let's imagine you have an asp.net page in front of you full of input
I have a 1 second jQuery .animate action that launches 5 seconds after page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.