Game Development Community

A template for slashing games like Fruit Ninja

by dunie · in iTorque 2D · 08/07/2011 (3:56 pm) · 6 replies

Hello everyone,

As a new iTorque user, I am looking for an existed iTorque template (or a sample project) that implements a basic slashing game like "Fruit Ninja".
I found Gamesalad and Corona have a lot of those kinds fo templates.
e.g.
http://www.youtube.com/watch?v=6h0-KhDuOJ8&feature=player_embedded
http://www.youtube.com/watch?v=z5kxP4MbwNo

Therefore, I really want to find some iTorque templates to do my fast prototyping.

I checked the "add-on" forum and webpage (http://www.garagegames.com/products/browse).
Some of them are really good. e.g. That TGB Platformer Kit seems sweet.
But I haven't found any template for a slashing game.

Do I need to write some C++ code at the logic level of iTorque engine to implement a slashing animation following user's finger?
If I want to implement that slashing action (both including animation and collision detecting), how to start my work?

Regards,
Dunie


#1
08/08/2011 (12:23 am)
You could spawn particle effect onTouchDragged. Maybe it should work.
#2
08/08/2011 (2:36 am)
Dunie - the Fruit Ninja style slice is achieved by drawing multiple connected polygons along the path drawn by the player, so that they increase in thickness near the middle, and animate from the start to the end of the slash.

Torque cannot skew images (vary the width of both ends separately) - they can only be rotated and uniformly scaled, so this effect could not be achieved in torque with basic imagemaps. The polygon object in torque can draw filled polygons which could be used to create this slash effect, but bear in mind they are untextured. Still, I think two or three of them of different colors, layered on top of each other, combined with a suitable particle effect would be just as good as Fruit Ninja.

In the script documentation the polygon objects are actually called shapeVector class. Look at the shapevector.setPolyCustom method to draw polygons.

#3
08/08/2011 (9:13 am)
Andrea, I think the particle effect is a plus (not necessary) for the slashing animation.

Conor, thanks for your informative reply. I will take a look at the shapevector.setPolyCustom.


#4
08/08/2011 (10:27 am)
@dunie: I don't know if particle effect can handle collision but if they can you can use particle effect.
#5
08/08/2011 (12:51 pm)
Still haven't found some exist iTorque templates/samples for the slashing animation... Maybe I really need to hack and figure it out by myself...
It seems that Corona SDK and Gamesalad communities are bigger than iTorque community now. I really hope iTorque community becomes bigger and bigger, since iTorque provides source code to paid users now.
#6
08/08/2011 (7:15 pm)
@Connor.
Could one not just have a schedule or a count in that, as long as the user is dragging, the polygonX is placed in the appropriate position, increasing in size... so if count == 0, size = 1 1, count = 2, size == 2 2 and so on.


Direction of the gesture can also influence rotation.