Sprite Animation not working on android device, but working on simulator

Hello Everyone!

I am having a strange problem:

  • I have a sprite animation ( a star rotating) on my game and it is supposed to be called when two buttons match ( I have a matching game I am working on! ).
    On the simulator, it works like a charm, but when I push onto an android device the animation (sprite) won’t show. Here’s the code snipet:
--requires--  
 local sprite = require("sprite")  
  
.  
.  
.  
.  
local onCompleteStar = function()  
  
 local hitsheet = sprite.newSpriteSheet("hitsprite1.png", 120, 63)  
  
 local hitset = sprite.newSpriteSet (hitsheet, 1, 16)  
 sprite.add (hitset, "hit", 1, 16, 620, 1)  
  
 local hit = sprite.newSprite (hitset)   
 hit.x = lastButton.x --50  
 hit.y = lastButton.y --110  
 hit:prepare("hit")  
 timer.performWithDelay(120, hit:play(), 1)  
 --remove the stars  
 local removeStars = function(event)  
 hit.x = - 120  
 end  
 timer.performWithDelay(1200,removeStars, 1)  
  
 end  
  
.  
.  
.  
.  
.  
 local poofDo = function()  
 local poofDoImage= display.newImageRect("do\_orb.png", 40, 40)  
 poofDoImage.x = lastButton.x;  
 poofDoImage.y = lastButton.y;  
 transition.to(poofDoImage, { 1400, alpha = 0, y = poofDoImage.y - 120, onComplete= onCompleteStar}) --calling the onCompleteStar   
  
 function removePoof\_1(event) poofDoImage:removeSelf() end;  
 timer.performWithDelay ( 1100, removePoof\_1 ,1 )  
  
 end  
   
.  
.  
.  
.  
.  
. --MORE CODE HERE  
  
--snippet code for when the buttons match. Here's where the poofDo() function is called, which calls -- the sprite animation...  
--If buttons DO match, remove buttons  
 elseif(lastButton.myName == object.myName ) then  
 lastButton:addEventListener("touch", lastButton)  
 if ( lastButton.myName and object.myName == 1) then  
 poofDo()  
 end  
  

I hope this makes sense. Like I said earlier, this works perfectly on the simulator, but doesn’t show the animation on the device (android).

Your help will be much appreciated.

Thanks in advance [import]uid: 75258 topic_id: 17532 reply_id: 317532[/import]

What kind of image is the sprite sheet?

Images have to be RGB color space, 8 Bit, not indexed.

Any chance there’s something up with that?

Peach :slight_smile: [import]uid: 52491 topic_id: 17532 reply_id: 66653[/import]

Hello Peach,

Funny that you were the first one to respond because I actually took an image from one of your packages you sell and modified it. I am talking about the shooter game you! So, I took one of your images ( the explosion sprite, the hitsprite.png) and instead of the explosions I placed stars… I was using Photoshop to make the changes. Again, I am not great at Photoshop, so there might be a possibility I, accidentally, set something that I was not supposed to. All I did, though was make the changes and saved the image.

What do you think? [import]uid: 75258 topic_id: 17532 reply_id: 66764[/import]

Hey there,

Firstly, thanks so much for your business!

Do you want to email me? Given you bought a template from me I’d be happy to take a look and see if I can work out what’s up.

From the sound of things I’d guess the image went whack but I can’t know that yet.

peachpellen [at] gmail.

Peach :slight_smile: [import]uid: 52491 topic_id: 17532 reply_id: 66872[/import]

…and sent!! Thank you very, very much for willing to help! Highly appreciated! [import]uid: 75258 topic_id: 17532 reply_id: 66920[/import]

@Peach Pellen helped me solve this problem. According to her it was all about changing the layout of the sprite as there is Texture size issues present on Android.

I just want, to once again, thank PEACH PELLEN for her amazing help! She is an amazing developer and above all, she goes out of her way to help our Corona Community. She is polite, efficient, patient, kind…etc… the list goes on and on! It’s because of her as well as people like her, and this wonderful product (Corona) I am here to stay for sure. Obrigado, Peach! [import]uid: 75258 topic_id: 17532 reply_id: 66940[/import]

+1!

I agree with all that said. :slight_smile:
PS: @pdichone are you Brazilian? You said “Obrigado” e isso soa pra mim como meu idioma Nativo! hehe…

Um abraço,
Rodrigo. [import]uid: 89165 topic_id: 17532 reply_id: 66942[/import]

Any time, honestly - you really were a joy to help :slight_smile:

I’m not quite as impressive as all that but I do my best - and I’m very happy I was able to assist.

I should clarify however it isn’t an issue exclusive to Android devices - some older iOS devices have it too.

Basically a good practice is just to layout your sprite sheet to make it as small as possible. (In a square.) Although I’m often guilty of not remembering this myself.

Thanks for all the kind words,
Peach :slight_smile:

PS - Rodrigo, you posted as I was writing - thanks for the +1, always nice to bump into you in the forum :slight_smile: [import]uid: 52491 topic_id: 17532 reply_id: 66955[/import]

E ai Rodrigao ! Cara eu nao sou Brazileiro nao. Sou de Mocambique !:slight_smile: Eu adoro Brazil pra caramba! Abraco:) [import]uid: 75258 topic_id: 17532 reply_id: 66972[/import]

Hey Mrs.,
You are welcome always and thanks for your patience. :slight_smile:

Peace! [import]uid: 89165 topic_id: 17532 reply_id: 67052[/import]

Falae @pdichone, irmão de Moçambique! Bacana saber disso! Eu sou brasileiro mas tô na Argentina por agora…

Sou novato por aqui (Lua/Corona) mas qualquer coisa é só falar.
Twitter: @RSCdev
Um abraço,
Rodrigo.
[import]uid: 89165 topic_id: 17532 reply_id: 67054[/import]

Ai Rodrigo meu irmao! Obrigado ai por oferecer a tua ajuda quando eu precisar. Valeu cara! Olha, o meu nome 'e Paulo!

Cara que voce ta fazendo na Argentina? O meu email 'e pdichone(arroba)gmail(ponto com).

Abraco,
Paulo [import]uid: 75258 topic_id: 17532 reply_id: 67185[/import]

Haha…falae Paulo!

Pois é, estou na Argentina com minha esposa pra conhecer o lugar. :slight_smile:

Te enviei um mail mermão.
Abraço,
Rodrigo. [import]uid: 89165 topic_id: 17532 reply_id: 67186[/import]

Ainda nao recebi nao! Mas acho que daqui ha pouco recebo!
Nossa, Argentina, uma maravilha memo! Manda ai link pra um does teus games que voce desenvolveu com corona cara. Eu tenho um chamado SoundMemory no Android Market ( lembrar que ainda sou novo com Corona, meu! Nao me censure tanto! :slight_smile: [import]uid: 75258 topic_id: 17532 reply_id: 67188[/import]

Haha…

Mandei o mail 5min atrás e ae, eu ainda não desenvolvi NADA! :frowning: Mas tô caminhando e estudando pra isso…:slight_smile:

PS: Eu tô focando a Apple Store apenas nesse momento, não tenho aprelho Android, então sou Indie Developer pra iOS apenas. Não conheço praticamente nada sobre o Android Market pra ser sincero, mas minha esposa começou a dar uma olhada com mais atenção e sendo assim, eu também vou no mesmo barco. hehe…vou procurar seu aplicativo no Android Market e ae, Parabéns!! Muito bom pra vc já ter até desenvolvido algum! Show de bola! (como dizemos aqui no Brasil pra algo muito bacana que acontece. hehe).

Abraço.
Rodrigo. [import]uid: 89165 topic_id: 17532 reply_id: 67190[/import]