All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ng.gdxutils.ai.formation.PlayerChildFormationPattern Maven / Gradle / Ivy

The newest version!
package com.ng.gdxutils.ai.formation;

import com.badlogic.gdx.ai.fma.FormationPattern;
import com.badlogic.gdx.ai.utils.Location;
import com.badlogic.gdx.math.Vector2;

/**
 * (c) 2016 Abhishek Aryan
 *
 * @author Abhishek Aryan
 * @since 12/13/2015.
 *
 */
public class PlayerChildFormationPattern implements FormationPattern {

    private int numberOfSlots;
    private float memberRadius;

    public PlayerChildFormationPattern(float memberRadius){
        this.memberRadius=memberRadius;
    }

    @Override
    public void setNumberOfSlots(int numberOfSlots) {
        this.numberOfSlots=numberOfSlots;
    }

    @Override
    public Location calculateSlotLocation(Location outLocation, int slotNumber) {
        outLocation.getPosition().set(-memberRadius/2+slotNumber*memberRadius*2,0);
        return null;
    }

    @Override
    public boolean supportsSlots(int slotCount) {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy