Package gwlpr.mapshard.entitysystem

Examples of gwlpr.mapshard.entitysystem.Entity


    public void onStopMoving(StopMovingEvent stopMove)
    {
        // we need to inform the connected clients and
        // set the movement state to notmoving

        Entity et = stopMove.getThisEntity();
       
        // update the movement component of the entity
        // note that as the entity is not moving anymore,
        // its future position is the position it has already reached!
        // this is necessary because the update movement view will send the future position
       
        Position pos = et.get(Position.class);
        Direction dir = et.get(Direction.class);
        Movement move = et.get(Movement.class);
       
        Vector2 direction1 = pos.position.vecWithEndpoint(move.moveAim);
       
        float angle = direction1.angleTo(dir.direction);
       
View Full Code Here


     */
    @Event.Handler
    public void onRotate(RotateEvent rot)
    {
        // fetch some entity info
        Entity et = rot.getThisEntity();
       
        // and update the direction
        Direction dir = et.get(Direction.class);
        dir.direction = dir.direction.applyRotation(rot.getCos(), rot.getSin());

        // inform the clients
        for (Handle<ClientBean> clientHandle : clientRegistry.getAllHandles())
        {
View Full Code Here

    {
        // check if this entity is a network client
        ClientBean client = clientRegistry.getObj(canSee.getThisEntity().getUuid());
        if (client == null) { return; }

        Entity et = canSee.getOtherEntity();

        EntitySpawningView.spawnAgent(client.getChannel(), et);
    }
View Full Code Here

    {
        // check if this entity is a network client
        ClientBean client = clientRegistry.getObj(lostSight.getThisEntity().getUuid());
        if (client == null) { return; }

        Entity et = lostSight.getOtherEntity();

        // send the despawn packets
        EntitySpawningView.despawnAgent(client.getChannel(), et);
    }
View Full Code Here

TOP

Related Classes of gwlpr.mapshard.entitysystem.Entity

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.