Like fruits, thought there was one example forgot the name, but didn’t work for me.
How is something like that done? [import]uid: 128294 topic_id: 26593 reply_id: 326593[/import]
Like fruits, thought there was one example forgot the name, but didn’t work for me.
How is something like that done? [import]uid: 128294 topic_id: 26593 reply_id: 326593[/import]
i’d like to know this too [import]uid: 147322 topic_id: 26593 reply_id: 107818[/import]
Bump if you ask me, don’t see many people discussing this topic.
[import]uid: 128294 topic_id: 26593 reply_id: 107960[/import]
oh well. [import]uid: 147322 topic_id: 26593 reply_id: 108070[/import]
We did have a sample however it had to be taken down. (There are threads about this.)
What part of the logic are you struggling with? [import]uid: 52491 topic_id: 26593 reply_id: 108814[/import]
OK but which *part* of the slashing? The visual effect of the slice itself, or cutting up the object? [import]uid: 52491 topic_id: 26593 reply_id: 108902[/import]
Both actually. [import]uid: 128294 topic_id: 26593 reply_id: 108955[/import]
Don’t understand how slashing works. Wish the recent corona beginner book that came out had a section about that.
[import]uid: 128294 topic_id: 26593 reply_id: 108885[/import]
actually, i would like to know more of the ‘move from side to side to execute a function’ part of it. no need for actual cutting. [import]uid: 147322 topic_id: 26593 reply_id: 109430[/import]
@Lakeview I can’t write the code for you so you’d have to show me what you’ve got as far as the object slicing goes and I can advise you from there.
For the line (the visual slice) you would draw a line (there’s code in the exchange for that) and then fade it out. You can draw it so that it is made up of multiple little lines if you want it to appear to fade from one end to the other.
@binc - for that you would mark down the X/Y where the event began and then in the moved/ended phases compare that X/Y to the current X/Y, that way you can see if it has moved a good distance or just a little and then act.
[import]uid: 52491 topic_id: 26593 reply_id: 109953[/import]
@peach pellen Forgot about this thread, sorry but when I’m able to work on this I will show you whats not working. [import]uid: 128294 topic_id: 26593 reply_id: 112023[/import]
That’s fine, no hurry, whenever you’re ready to update the thread I will get an email notification
[import]uid: 52491 topic_id: 26593 reply_id: 112134[/import]
HI Peach,
I also stuck in this type of issue, i wanted to slice object but i am not getting how shall i do the visual effect on this. I want it to look like fruit ninja.
Can you help me out please???
Regards
Varun [import]uid: 130269 topic_id: 26593 reply_id: 124300[/import]
Here’s a sample for the visual effect:
[lua]local line={}
local i=1
local bx, by=0, 0
local function fruitNinjaVisual(event)
if “began”==event.phase then
bx, by=event.x, event.y
elseif “moved”==event.phase then
line[i]=display.newLine(bx, by, event.x, event.y)
line[i]:setColor(60, 60, 255)
line[i].width=18
local me=line[i]
line[i].transition=transition.to(me, {alpha=0, width=2, time=300})
bx, by=event.x, event.y
timer.performWithDelay(300, function() me:removeSelf() me=nil end)
i=i+1
end
end[/lua]
Hope it helps! [import]uid: 147322 topic_id: 26593 reply_id: 124348[/import]
Thanks man for your code sharing… [import]uid: 130269 topic_id: 26593 reply_id: 124349[/import]
HI Peach,
I also stuck in this type of issue, i wanted to slice object but i am not getting how shall i do the visual effect on this. I want it to look like fruit ninja.
Can you help me out please???
Regards
Varun [import]uid: 130269 topic_id: 26593 reply_id: 124300[/import]
Here’s a sample for the visual effect:
[lua]local line={}
local i=1
local bx, by=0, 0
local function fruitNinjaVisual(event)
if “began”==event.phase then
bx, by=event.x, event.y
elseif “moved”==event.phase then
line[i]=display.newLine(bx, by, event.x, event.y)
line[i]:setColor(60, 60, 255)
line[i].width=18
local me=line[i]
line[i].transition=transition.to(me, {alpha=0, width=2, time=300})
bx, by=event.x, event.y
timer.performWithDelay(300, function() me:removeSelf() me=nil end)
i=i+1
end
end[/lua]
Hope it helps! [import]uid: 147322 topic_id: 26593 reply_id: 124348[/import]
Thanks man for your code sharing… [import]uid: 130269 topic_id: 26593 reply_id: 124349[/import]
Hi Friends
Is there any other alternative other than line, as the line is not looking good, cant we have knife like real fruit ninja?
Please reply
Regards
Varun [import]uid: 130269 topic_id: 26593 reply_id: 129677[/import]
Hi Friends
Is there any other alternative other than line, as the line is not looking good, cant we have knife like real fruit ninja?
Please reply
Regards
Varun [import]uid: 130269 topic_id: 26593 reply_id: 129677[/import]