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 8135133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:18:47+00:00 2026-06-06T10:18:47+00:00

Am am making a wap-game that will have a minimap. It is basically a

  • 0

Am am making a wap-game that will have a minimap. It is basically a 5×5 div with (a) 20×20 pixel background image(s).

I’ve come to a stalemate trying to figure out on how to design them, though.

Making a 100×100 pixel image for each ‘location’ wouldn’t be a good idea, since if one of those 20×20 locations changed, I would have to update 15 100×100 images.

Two choices are left then:

  • Combining the 20×20 pixel images to a big 100×100 pixel one using GD
  • Giving each div in the minimap a background with the 20×20 location image.

In the second scenario a lot of HTTP requests would me made to fetch the images, in the first, server resources would be used to combine them to a big image.

Which of the options do you think would be a more efficient one? Basically I see it as a lose-lose situation, but one has to decide which loss is less painful.

  • 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-06-06T10:18:49+00:00Added an answer on June 6, 2026 at 10:18 am

    Why don’t you check out CSS SPRITES?

    http://spriteme.org/

    Then you can generate the map with a php function that select the CSS class (with its relative background) randomly.

    If you have let’s say 9 different parts of map 20×20, to be combined in a 3×3 grid, you just have to create a class for each piece of map. You can generate it dinamically (replace 0px 0px with a “$x = rand(0,3)*20; $y = rand = rand(0,3)*20;” or so.

    .map1 {
        background-image:url(/images/css_sprite.png);
        background-position:0px 0px;
        background-size:20px 20px;
    }
    

    1 HTTP request to be called, and no server resources to be wasted in GD!

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

Sidebar

Related Questions

Making game of life I need to a have a grid that is 30x20
Making a ship game because I am incredibly original.. With that aside, I have
Making a simple program which will generate a multiple choice form. I have an
Im making a flash app that will capture video from the users web-cam, show
Making an adobe flex ui in which data that is calculated must use proprietary
Making UML sequence diagram in VS 2010RC I've observed that there is no activation
Making websites that appear correctly in IE is a big problem. Is there any
While making some final tests of a class-library that I'm writing for Windows Mobile
When making relations between tables (in mysql), I have encountered a naming dilemma. For
Im making a login/logout class that logs users in, sets cookies based on user's

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.