Fruit Ninja

BlueFanStudiosBlueFanStudios Member Posts: 77
edited January 2012 in Working with GS (Mac)
http://arcade.gamesalad.com/game/3456

I found this Fruit Ninja style template from ToastKitten. I noticed that when you cut on that template, you can't simply just hold your finger in place, you have to actually do the cutting motion. I was wondering what the most effective method to achieve this would be.

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    edited January 2012
    I would make four attributes, mouse x 1, mouse x 2, mouse y 1, mouse y 2.
    Then make some timers. Every two seconds, change attribute mouse x1 to mouse position x, and same with y1 and mouse position y.
    Then another, after .1 second, inside that, every .2 seconds... change attribute mouse x2 to mouse position x, and same with y2 and mouse position y.

    Now make a rule for the cutting behavior. If magnitude(x1-x2,y1,y2) > (30 or something, you'll have to experiment.)
    this magnitude is the distance between the old mouse position, and the new mouse position, .1 seconds apart, which should give a good estimate of mouse speed>

    Then in that rule, have whatever you're doing to make it cut.

    That should do it.

    Asymptoteell
  • BlueFanStudiosBlueFanStudios Member Posts: 77
    Thanks :) I'll try that out and let you know if it works
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Great. If it doesnt work, just say here, and I'll try to see what's wrong with it.
Sign In or Register to comment.