Question

I'am a newbie to andengine. I have a situation wherein I have to slice/cut a particular sprite into multiple sprites, how can I achieve that?

Was it helpful?

Solution

You won't be able to do this using andEngine functionalities. You have to implement such thing by yourself.

Let's talk about it and look on slicing fruit (like in fruit ninja;) ) You should have 3 sprites for a watermelon. two halves and whole fruit. After slicing it you should hide whole watermelon and show two halves at good place by setting it's x, y and rotation. (You will have to read and calculate slice position and direction somehow. It will look much more realistic)

Why 2 halves instead of one if they are the same? They shouldn't be the same if you want some 3d effect. One of that sprite will show some of watermelon inside (you know, that red thing you eat;) )

The other possibility is similiar but instead of attaching and detaching sprites you can have two sprites attached togheter in a way that they will look like a whole watermelon.

PS if I remember well fruit ninja has 3d fruit models so your objects won't look so cool in 2d (they won't rotate in z-axis). I used fruit ninja as an example but you probably want only similiar effect. I don't know any other possibility to do that in andengine. I want to say that it won't be easy task to implement such thing.

PS2 If i helped click the up arrow and tick it as an answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top