9 years ago by Arturo
Hi!
I have a problem with impact that I wasnt aware of.
On my game, I dont use tiles, I use full images instead. I pretend that they are tiles, and I use them on WM, by dividing the big image in exact big squares (480px, 800px.... etc). Like this, I can keep working with WM and see the results of the image (to place object, etc).
I know WM is for tiles, but is similar concept I guess... and also is less complicate (my character is always centered, so I dont have to calculate the position of the images all the time, if I do it with WM)
Anyway... each image, is around 1.5MB, 700KB (1 png and the other is jpg).
With this method I found two problems....
1- I cant put more than 3 layers like this, if the layer are really big... the browser slow down suddenly so much... this is not a big problem, I just stick to the 2-3 layers with this image method.
2- And this is a big problem... after playing from start to the middle... after 10 levels... impact doesnt load the images anymore, but doesnt give any errors either. Load the player, and entities, and is playable, but not the images. sometimes load 1 layer or 2... but not the full layers of the game. Sometimes load some part of the layer...
I thought this is something realed to the memory of the game, that is full cos the images are too big, so I should be refreshing the images everytime I call a new level, but this doesnt seems to work....
I saw this post:
ImpactJS memory management
But I coundnt make it work (the game keep asking me for the images that I remove with
Any clue where I should keep trying?
Thanks!
I have a problem with impact that I wasnt aware of.
On my game, I dont use tiles, I use full images instead. I pretend that they are tiles, and I use them on WM, by dividing the big image in exact big squares (480px, 800px.... etc). Like this, I can keep working with WM and see the results of the image (to place object, etc).
I know WM is for tiles, but is similar concept I guess... and also is less complicate (my character is always centered, so I dont have to calculate the position of the images all the time, if I do it with WM)
Anyway... each image, is around 1.5MB, 700KB (1 png and the other is jpg).
With this method I found two problems....
1- I cant put more than 3 layers like this, if the layer are really big... the browser slow down suddenly so much... this is not a big problem, I just stick to the 2-3 layers with this image method.
2- And this is a big problem... after playing from start to the middle... after 10 levels... impact doesnt load the images anymore, but doesnt give any errors either. Load the player, and entities, and is playable, but not the images. sometimes load 1 layer or 2... but not the full layers of the game. Sometimes load some part of the layer...
I thought this is something realed to the memory of the game, that is full cos the images are too big, so I should be refreshing the images everytime I call a new level, but this doesnt seems to work....
I saw this post:
ImpactJS memory management
But I coundnt make it work (the game keep asking me for the images that I remove with
ig.Image.cache = {};
Any clue where I should keep trying?
Thanks!