Examples of MoveRandomControl


Examples of com.teamjmonkey.controls.MoveRandomControl

    @Override
    public void addControl() {
        float circleRadius = 40f;
        WalkableArea wa = new WalkableRectangle(-circleRadius, -circleRadius, 2 * circleRadius, 2 * circleRadius); //TODO adjust adjust walkable area
        spatial.addControl(new MoveRandomControl(this, wa));
        spatial.addControl(new AggroControl(this, circleRadius * 1.5f, size,
                PhysicsCollisionObject.COLLISION_GROUP_06,
                PhysicsCollisionObject.COLLISION_GROUP_04,
                new AggroBehaviorChaseFood(wa, 10f),
                new AggroBehaviorEat(this)));
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

        interruptOtherActions();
        entity.lookAt(target.getLocalTranslation(), speed, false);
    }

    private void interruptOtherActions() {
        MoveRandomControl mrc = spatial.getControl(MoveRandomControl.class);
        if (mrc != null) {
            mrc.pause();
        }
    }
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

            mrc.pause();
        }
    }

    private void resumeOtherActions() {
        MoveRandomControl mrc = spatial.getControl(MoveRandomControl.class);
        if (mrc != null) {
            mrc.resume();
        }
    }
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

        interruptOtherActions();
        entity.jumpAnim();
    }

    private void interruptOtherActions() {
        MoveRandomControl mrc = spatial.getControl(MoveRandomControl.class);
        if (mrc != null) {
            mrc.pause();
        }
        entity.stop();
    }
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

        }
        entity.stop();
    }

    private void resumeOtherActions() {
        MoveRandomControl mrc = spatial.getControl(MoveRandomControl.class);
        if (mrc != null) {
            mrc.resume();
        }
    }
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

        interruptOtherActions();
        entity.moveTo(target.getLocalTranslation(), speed, 1f);
    }

    private void interruptOtherActions() {
        MoveRandomControl mrc = spatial.getControl(MoveRandomControl.class);
        if (mrc != null) {
            mrc.pause();
        }
        entity.stop();
    }
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

        }
        entity.stop();
    }

    private void resumeOtherActions() {
        MoveRandomControl mrc = spatial.getControl(MoveRandomControl.class);
        if (mrc != null) {
            mrc.resume();
        }
    }
View Full Code Here

Examples of com.teamjmonkey.controls.MoveRandomControl

    private void addEnemy(Enemy enemy, float enemySize, Vector3f spawn) {
        float areaSizeX = 20f;
        float areaSizeZ = 20f;
        WalkableArea wa = new WalkableRectangle(spawn.getX() - (areaSizeX / 2f), spawn.getZ() - (areaSizeZ / 2f), 20f, 20f);
        enemy.getSpatial().addControl(new MoveRandomControl(enemy, wa));
        enemy.getSpatial().addControl(new AggroControl(enemy, 25f, enemySize,
                PhysicsCollisionObject.COLLISION_GROUP_02,
                PhysicsCollisionObject.COLLISION_GROUP_03,
                new AggroBehaviorChase(wa, 6f),
                new AggroBehaviorFight(1f, 2f)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.