Package com.pointcliki.dizgruntled.map

Examples of com.pointcliki.dizgruntled.map.MapEntity.offset()


    addChild(fMapViewer);
    fMapViewer.init();
   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
View Full Code Here


    addChild(fMapViewer);
    fMapViewer.init();
   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
View Full Code Here

    addChild(fMapViewer);
    fMapViewer.init();
   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
View Full Code Here

    fMapViewer.init();
   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
View Full Code Here

    fMapViewer.init();
   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
View Full Code Here

    fMapViewer.init();
   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
View Full Code Here

   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
    timeManager().dispatcher().addMinion(TimeEvent.TYPE, scroller);
View Full Code Here

   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
    timeManager().dispatcher().addMinion(TimeEvent.TYPE, scroller);
View Full Code Here

   
    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
    timeManager().dispatcher().addMinion(TimeEvent.TYPE, scroller);
View Full Code Here

    Minion<TimeEvent> scroller = new Minion<TimeEvent>() {
      public long run(com.pointcliki.event.Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_RIGHT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x - event.delta() / 2f, -fMapViewer.map().width() * 32f + fSW), 0), fMapViewer.offset().y));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_LEFT)) fMapViewer.offset(new Vector2f(Math.min(Math.max(fMapViewer.offset().x + event.delta() / 2f, -fMapViewer.map().width() * 32 + fSW), 0), fMapViewer.offset().y));
        if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_DOWN)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y - event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        else if (GruntzGame.inputManager().isKeyPressed(Keyboard.KEY_UP)) fMapViewer.offset(new Vector2f(fMapViewer.offset().x, Math.min(Math.max(fMapViewer.offset().y + event.delta() / 2f, -fMapViewer.map().height() * 32 + fSH), 0)));
        return Minion.CONTINUE;       
      };
    };
    timeManager().dispatcher().addMinion(TimeEvent.TYPE, scroller);
   
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.