Steer fly carrot with mouse

Version:

1.0

Added on:

03 Feb 2015 22:27

Tags:

Description:
As with any mouse-based code, doesn't work so well in splitscreen or 3D.
  1. void onPlayer(jjPLAYER@ play) {
  2.   if (play.fly == FLIGHT::FLYCARROT) {
  3.     play.ySpeed = (jjMouseY + play.cameraY - play.yPos) / 8; //adjust "8" until you get a speed/distance ratio that feels right to you
  4.     play.xSpeed = (jjMouseX + play.cameraX - play.xPos) / 8;
  5.     play.direction = (play.xPos > jjMouseX + play.cameraX) ? -1 : 1;
  6.   }
  7. }