I need to develop cutting effect like in fruit ninga,veg samurai game in iphone -


i new developing games (and new software development field) in iphone.i need develop cutting effect in fruit ninga , veg samurai , cut cut boom games.i dont know how this.i search lot that, find distance , angle vector ,then apply 4x4 matrix...(or) said use opengl develop function this...like said, use opengl draw doesn't that.can that.... give sample code developing cutting effect ....thanks in advance....

here draw function ur convenience..... -(void) draw {

if([_points count] > 0) {      gldisable(gl_texture_2d);     gldisableclientstate(gl_color_array);     gldisableclientstate(gl_texture_coord_array);       glenable(gl_texture_2d);     glenableclientstate(gl_color_array);     glenableclientstate(gl_texture_coord_array);     glenable(gl_line_smooth);     glcolor4f(20, 20, 20, 20);        for(int i=0;i<[_points count]-1;i++)     {         if(i<=1)         {             gllinewidth(5.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>1 && i<=2)         {             gllinewidth(5.5f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>2 && i<=3)         {             gllinewidth(6.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>3 && i<=4)         {             gllinewidth(7.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>4 && i<=5)         {             gllinewidth(8.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>5 && i<=6)         {             gllinewidth(9.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>6 && i<=7)         {             gllinewidth(10.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>7 && i<=8)         {             gllinewidth(11.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>8 && i<=9)         {             gllinewidth(12.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>9 && i<=10)         {             gllinewidth(13.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>10 && i<=11)         {             gllinewidth(14.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>11 && i<=12)         {             gllinewidth(15.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }         if(i>12 && i<=13)         {             gllinewidth(16.0f);             movepoints *p1 = (movepoints*)[_points objectatindex:i];             movepoints *p2 = (movepoints*)[_points objectatindex:i+1];             ccdrawline(p1.location,p2.location);         }     }     [super draw]; } 

and update function fade out line - (void) update:(cctime) dt { double = [[nsdate date] timeintervalsince1970];

if(lasttimetrailremoved == 0) {     lasttimetrailremoved = now;     return; }  if(((now - lasttimetrailremoved) > 0.03f) && ([_points count] > 0)) {     nslog(@"removing last point");     [_points removeobjectatindex:0];     [_points removeobjectatindex:1];     [_points removeobjectatindex:2];     [_points removeobjectatindex:3];      lasttimetrailremoved = now; } 

}

looking on code, see several issues. take step , start more basic. problem 'cutting edge' done people advanced , can create new, awesome stuff, hence cutting edge. might recommend book on games development? apress: beginning iphone games development read.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -