Posted By

ozkriff on 10/23/08


Tagged


Versions (?)

man::move


 / Published in: C++
 

not working

  1. void Man::move()
  2. {
  3. int a, b, c = MAN_SIZE / 20; //tmp
  4.  
  5. b= c*sin( rot_angle );
  6. a= c*cos( rot_angle );
  7. switch ( w )
  8. {
  9. case 1:
  10. x += b;
  11. y += a;
  12. break;
  13. case -1:
  14. x -= b;
  15. y -= a;
  16. break;
  17. default:
  18. break;
  19. }
  20.  
  21. //Move the Man left or right
  22. x += Vel_x;
  23.  
  24. //Move the Man up or down
  25. y += Vel_y;
  26.  
  27. //Rotate the Man
  28. switch ( rot )
  29. {
  30. case 1: rot_angle += rot_speed; break;
  31. case -1: rot_angle -= rot_speed; break;
  32. default: break;
  33. }
  34.  
  35. }

Report this snippet  

You need to login to post a comment.