Hovering Objects

Hi all,

I am new to Corona over the last couple of days and very excited by what I am seeing! I was just wondering if someone could point in the right direction for something I am trying to accomplish in the game that I am working on as I try to learn.

I have a series of instances of a hovering vehicle on screen and I would like each of them to hover in a realistic manner, as in moving around slightly and not just sitting static. Is there a recommendation or best practice for this sort of thing?

Each of these vehicles will need to be a physics body, handle collisions, and move from place to place on screen. I am seeing sprite sheets and movieclips as viable alternatives but it also seems that having multiple images to load into a movieclip or a larger sprite sheet just to shift an image around by a few pixels is wasteful in terms of file size.

There may be dozens of these guys onscreen at the same time. That being the case, do you think I could get away with having a single image file and shift it around in a pseudorandom way for each instance using calculated transitions ?

Any thoughts, examples, sample code, etc. would be greatly appreciated!

Thanks! [import]uid: 10232 topic_id: 3073 reply_id: 303073[/import]

Hi SteveCross,
When you say hover, do you mean that slight bounce while being in the same position? That can be achieved even without physics. You can animate your sprite with the slight movement, so that way, even when it is stationary, it will look as if it is hovering over the spot.

I am also kind of new to Corona, so I am not 100% on this, but the texture handling or the sprite handling routines have been optimised, so even if you have a dozen of these same sprites on screen, corona does some super memory management and takes care of that (please correct me if I am assuming this wrong).

I hope this gets you to think in terms of what you were after

cheers,

Jayant C Varma [import]uid: 3826 topic_id: 3073 reply_id: 9172[/import]