Package com.teamjmonkey.controls

Examples of com.teamjmonkey.controls.AggroControl


    @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


    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)));
        enemy.finalise();
View Full Code Here

TOP

Related Classes of com.teamjmonkey.controls.AggroControl

Copyright © 2018 www.massapicom. 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.