WeHeartGaming / CraftingTable

See the recipes by searching and clicking.
2 stars 1 forks source link

Improvement: use sprites for loading the images #3

Open qgustavor opened 11 years ago

qgustavor commented 11 years ago

When the images are being loaded the recipes are shown incomplete, using sprites it can be loaded faster. Also improving bandwidth use by allowing a lower quality version of the images for non-retina screens.

ProfChaos commented 11 years ago

I'll start working on it right away

qgustavor commented 11 years ago

I'm posting a commit soon with some changes on the HTML, Javascript and folder organization:

ProfChaos commented 11 years ago

Sweet! I was planning to clean the code a bit and comment it.

qgustavor commented 11 years ago

https://github.com/qgustavor/CraftingTable/commit/3bee0bfb9d4db555d5420c1528bca1d1b920147c

My commit still have a problem: sometimes when I click the content disappears. I'm trying to clean the code to make debugging easier. How about...

Also, is there better ways to store item and crafting data? Find a way to stop storing some integers as strings?

Edit: after this big commit, for now only small commits.

ProfChaos commented 11 years ago

Almost all of the responsive behavior is CSS, but some is not. Like the hiding and showing the item list, hiding the crafting table and vice versa.

If you know of a better way to do it, go for it! I might learn something!

using what to render blocks? I was looking for sprite sheets for minecraft. Might have to make my own.

Sounds good

For the items as well as all the static text?

I guess we could change it to floats from 5-1 to 5,1, or nest it as a sub array somehow?!

qgustavor commented 11 years ago

So change all responsible behavior to CSS, I don't saw any @media query on the CSS so I think you're talking about bootstrap responsible css. You can use bootstrap helper classes to hide then, or make your own.

All images are renders, so as the game pick a texture and make it a block let's do the same, so we can reduce the size of some images to their original size. Some blocks that need special rendering can use a separate space on the spritesheet.

Minecraft is internationalized, so, at least, it can use the block names from the game languages. I'm don't play on my native language, but I know people that play, and there's a huge difference between the original and the translated name for some blocks.

I will make some tests for each one, first the hidden button bug, that's annoying me, then the spritesheets.