Ejemplo n.º 1
0
        public virtual void onMouseMove(ACView pview, Point point)
        {
            if (GameOver)
            {
                return; //Don't use mouse or keyborad messages until game starts.
            }
            if (PlayerListenerClass == "cListenerCursor")
            {
                return;
            }

            /* We pass this on, but ordinarily the critters don't do anything with it. */
            //The _cursorpos gets set in CView.OnMouseMove if you're dragging.
            // Drag Hand Case, with (_hcursor == ((CpopApp*).AfxGetApp())->_hCursorDragger)
            if ((pFocus() != null) && _bDragging)
            {
                cVector3 cursorforcritter = pview.pixelToCritterPlaneVector(point.X, point.Y, pFocus());

                /* It's going to easier, at least to start with, to drag only within the focus critter
                 * plane. */
                pFocus().dragTo(cursorforcritter, _pcontroller.dt()); /* Feed the current _dt to dragTo
                                                                       * so as to set the critter's velocity to match the speed of the drag; this way you
                                                                       * can "throw" a critter by dragging it. */
                _pbiota.processServiceRequests();                     /* In case critter reacts.
                                                                       * If you wait for the timer to trigger CpopDoc.stepDoc
                                                                       * to call the processServiceRequest, you might possibly manage to
                                                                       * click or drag the same critter again.  The reason is that you may
                                                                       * have several OnMouseMove messages in the message queue, and when they
                                                                       * are processed you will get several calls to onMouseMove. */
            }
        }