OK, here's a bit of a long shot. Has anyone here seen the game Fruit Ninja for the iOS? In the game, there's an object on the screen, and you swipe your finger across the object like you were slicing it in half with a sword. And the object seperates into two pieces on your slash line and both pieces fall.
I'm trying to figure out how to do something like that. Before I go bang my head against the way figuring this out, I figured I'd ask in here to see if anyone has ever done anything like that before. Anyone? Any ideas? If I can figure out how to do it, I'll post the code...
Fruit Ninja?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Fruit Ninja?
I have never done this exact thing before, but I have made many games in LiveCode.
I assume you are referring to the problem of cutting an image, or simulating it. I don't think there is a way to actually cut an image in LiveCode, at least in the pace that you need. However, there are several ways to simulate it.
Are you looking for 3d graphics? Fruit Ninja is 3d, so to simulate that would take a frightful amount of .png icons.
1. Cover up part of the image. This could get messy, however, and I think it would only work with a solid background.
2. There might be a way to do it by shrinking a button whose icon is the fruit.
3. Make two images in photoshop for the two halves. When you slash, quickly set the angle of the whole fruit to the angle of the slash line. Then set the loc of the two halves to the corresponding place over the whole fruit, give them a bit of rotation and sideways force and let your physics do the rest. This is what I would probably do.
If you are referring to the slashing or something else, I'll try to answer.
Dave
I assume you are referring to the problem of cutting an image, or simulating it. I don't think there is a way to actually cut an image in LiveCode, at least in the pace that you need. However, there are several ways to simulate it.
Are you looking for 3d graphics? Fruit Ninja is 3d, so to simulate that would take a frightful amount of .png icons.
1. Cover up part of the image. This could get messy, however, and I think it would only work with a solid background.
2. There might be a way to do it by shrinking a button whose icon is the fruit.
3. Make two images in photoshop for the two halves. When you slash, quickly set the angle of the whole fruit to the angle of the slash line. Then set the loc of the two halves to the corresponding place over the whole fruit, give them a bit of rotation and sideways force and let your physics do the rest. This is what I would probably do.
If you are referring to the slashing or something else, I'll try to answer.
Dave
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Re: Fruit Ninja?
I like the idea of setting the angle really quick. We're not doing fruit like they are, or 3d - we're doing more like a flash card or index card - that sort of thing. I was also thinking maybe I'd do a few variations on it, to cover a bunch of different angles. Thanks for the ideas - if I can get it working, I'll share. 
