Examples of WalkableRectangle


Examples of com.teamjmonkey.ai.areas.WalkableRectangle

    }

    @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),
View Full Code Here

Examples of com.teamjmonkey.ai.areas.WalkableRectangle

    }

    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();
        enemy.getSpatial().setLocalTranslation(wa.getRandomPointInside(spawn.getY()));
        rootNode.attachChild(enemy.getSpatial());
    }
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.