Move to Touch

Ok, I am moving a sprite to a touch location, but I want to rotate the sprite so that it is pointing at the location to move to, does mte have a way of doing this or can I just rotate the sprite myself?

I added my own transition before the move, but would be nice if moveSpriteTo had rotation as a parameter :slight_smile:

Thanks, Greg

Hello Greg,

I see you found your own solutions but I wanted to touch bases anyway. My goal in making the engine was to solve certain problems inherent in using tile maps in Corona SDK, so anywhere an unreasonable performance restraint rears its ugly head MTE steps in with a solution or workaround. Rotating sprites is easily achieved with Corona’s transitions as-is. Basically it’s out of scope. I do like making things as easy as possible for developers, but right now my focus is more on providing good documentation, taking care of a few loose ends, and setting everything up for a solid 1.0 release.

That said, I’m always happy to answer questions! It just may take a little longer than usual these days, what with everything going on.

Thanks for the info dyson,  the transition.to worked great.

I am trying to use touch only, and when I move to the edge of the map, is there a way to detect this within mte so that I can load an adjoining map or do I have to do that outside the engine with sprite position?

Super job so far!

Greg

I’m actually working on a map stitching functionality right now, though it won’t be available for another week or two due to the scale of the needed changes. It is currently possible to load a second map in a second instance of MTE with it’s camera positioned such that the two lay side-by-side, now that you mention it. You’d have to take care of inserting sprites into the second map as needed, in that case.

interesting, but since I will have 64 maps, all arranged in a 8x8 grid, I am better off loading the next map.  I just need to trigger when to load based on when my ship hits the edge.   I could add objects to the maps that would trigger the jump right?  That or just detect that the ship has hit the edge of the map somehow.   Any ideas for the easiest solution :slight_smile:

Thanks, Greg

Oh that’s an easy one, just a matter of examining the ship’s position. For example, if ship.levelPosX == 1 then it is on the left edge of the map. You can find the right side with simple multiplication. If ship.levelPosX == mapWidth * tileWidth then it is on the right edge of the map. You can retrieve the map width and tile width programmatically by calling ‘local map = mte.getMap()’ and reading map.width and map.tilewidth.

Hello Greg,

I see you found your own solutions but I wanted to touch bases anyway. My goal in making the engine was to solve certain problems inherent in using tile maps in Corona SDK, so anywhere an unreasonable performance restraint rears its ugly head MTE steps in with a solution or workaround. Rotating sprites is easily achieved with Corona’s transitions as-is. Basically it’s out of scope. I do like making things as easy as possible for developers, but right now my focus is more on providing good documentation, taking care of a few loose ends, and setting everything up for a solid 1.0 release.

That said, I’m always happy to answer questions! It just may take a little longer than usual these days, what with everything going on.

Thanks for the info dyson,  the transition.to worked great.

I am trying to use touch only, and when I move to the edge of the map, is there a way to detect this within mte so that I can load an adjoining map or do I have to do that outside the engine with sprite position?

Super job so far!

Greg

I’m actually working on a map stitching functionality right now, though it won’t be available for another week or two due to the scale of the needed changes. It is currently possible to load a second map in a second instance of MTE with it’s camera positioned such that the two lay side-by-side, now that you mention it. You’d have to take care of inserting sprites into the second map as needed, in that case.

interesting, but since I will have 64 maps, all arranged in a 8x8 grid, I am better off loading the next map.  I just need to trigger when to load based on when my ship hits the edge.   I could add objects to the maps that would trigger the jump right?  That or just detect that the ship has hit the edge of the map somehow.   Any ideas for the easiest solution :slight_smile:

Thanks, Greg

Oh that’s an easy one, just a matter of examining the ship’s position. For example, if ship.levelPosX == 1 then it is on the left edge of the map. You can find the right side with simple multiplication. If ship.levelPosX == mapWidth * tileWidth then it is on the right edge of the map. You can retrieve the map width and tile width programmatically by calling ‘local map = mte.getMap()’ and reading map.width and map.tilewidth.