Fruit Ninja sort different fruits

Get help using Construct 2

Post » Fri May 03, 2013 4:34 am

So I'm making a game like Fruit Ninja. But I want to insert, let's say, 100 differents fruits to be thrown. How I can make this happen? I know I can do one by one, but it's going to take a lot of work. So I want a simpler way to do that.

I have an idea, but i just don't know how to implement properly on C2. My idea is to create an .txt that goes to 1 to 100. Using the Ajax plugin I could insert this on C2 (right?). Than I could make each number represent an different fruit and than randomize which fruits are going to be thrown.

How I can make this happen? By the way, if you have another suggestion that could be easier, please share! ;-)

[]'s
almeidamarcell2013-05-03 04:43:57
B
16
S
4
G
4
Posts: 56
Reputation: 2,942

Post » Fri May 03, 2013 7:59 am

Hey Almeid,

I just did a little test with families that you might be interested in. It seems that when you call the family object itself to be spawned it will spawn a random sprite within that family.

http://db.tt/LVb7t1l0GenkiGenga2013-05-03 08:01:12
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Thu May 09, 2013 6:53 pm

[QUOTE=GenkiGenga] Hey Almeid,

I just did a little test with families that you might be interested in. It seems that when you call the family object itself to be spawned it will spawn a random sprite within that family.

http://db.tt/LVb7t1l0[/QUOTE]

Thanks a lot @GenkiGenga, it solved my problem. But I still have the problem of insert one by one of my words, this is going to be more than 1000 events if I keep doing this way. Here is my .capx file so you can see what I mean https://dl.dropboxusercontent.com/u/8017129/ninjas-do-portugues.capx

By the way, sorry I took to long to answer. I was very busy and this is just my side project.

:)
B
16
S
4
G
4
Posts: 56
Reputation: 2,942

Post » Fri May 10, 2013 1:02 am

Up!

Anyone.....?
B
16
S
4
G
4
Posts: 56
Reputation: 2,942

Post » Sat May 11, 2013 12:47 am

No worries. Sorry I don't have the fps plugin, If you can you post it again without I'll take a look.

ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Sat May 11, 2013 3:16 am

[QUOTE=GenkiGenga] No worries. Sorry I don't have the fps plugin, If you can you post it again without I'll take a look.

[/QUOTE]

here's the link to the behavior https://dl.dropbox.com/u/5779181/C2Repo/Zip/behaviors/rex_text_fpsmonitor.7z
B
40
S
10
G
5
Posts: 102
Reputation: 6,602

Post » Sat May 11, 2013 5:06 pm

@GenkiGenga

Here is the .capx without the fps monitor https://dl.dropboxusercontent.com/u/8017129/ninja%20do%20porutgues%20sem%20fps.capx
B
16
S
4
G
4
Posts: 56
Reputation: 2,942

Post » Sun May 12, 2013 7:34 am

Cheers for the link @OrangeTapioca

Just took a quick look Almeid, so I see you have a random fruit coming up every 0.5 seconds.

Where you are destroying your objects after they fall you can save yourself a lot of events by checking if the fruit family object is overlapping instead of checking for each object individually.

For the 100 events needed for slicing the fruit, the easiest thing to do would be to continue manually doing it for each object (if your game is only small it shouldn't make a difference to speed).

If you really want a 1-Slice-splits-all event you will need to get creative, since you are spawning two specific objects depending on the fruit.

Hope that helps.GenkiGenga2013-05-12 07:36:55
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest