Codota Logo
Settings
Code IndexAdd Codota to your IDE (free)

How to use
Settings
in
com.jmr.ge.setting

Best Java code snippets using com.jmr.ge.setting.Settings (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: jmrapp1/SpaceInvaders

public OrthoCamera() {
  this(new VirtualViewport(Settings.getWidth(), Settings.getHeight()));
}
 
origin: jmrapp1/SpaceInvaders

public static void instantiateSettings() {
  Settings.addSetting("width", 480);
  Settings.addSetting("height", 800);
  Settings.addSetting("tilesize", 25);
}
origin: jmrapp1/SpaceInvaders

public static int getTileSize() {
  return (Integer)getSetting("tilesize");
}
 
origin: jmrapp1/SpaceInvaders

public void focusCamera(int width, int height, OrthoCamera camera) {
  float camX = 0, camY = 0;
  
  if (width * Settings.getTileSize() - pos.x >= (Settings.getWidth() / 2) * camera.zoom)
    camX = pos.x;
  else if (width * Settings.getTileSize() - pos.x <= (Settings.getWidth() / 2) * camera.zoom && pos.x > (Settings.getWidth() / 2) * camera.zoom)
    camX = width * Settings.getTileSize() - (Settings.getWidth() / 2) * camera.zoom;
  
  if (pos.x <= (Settings.getWidth() / 2) * camera.zoom)
    camX = (Settings.getWidth() / 2) * camera.zoom;
  else if (pos.x > (Settings.getWidth() / 2) * camera.zoom && pos.x < width * Settings.getTileSize() - (Settings.getWidth() / 2) * camera.zoom) 
    camX = pos.x;
  
  if (height * Settings.getTileSize() - pos.y > (Settings.getHeight() / 2) * camera.zoom)
    camY = pos.y;
  else if (height * Settings.getTileSize() - pos.y <= (Settings.getHeight() / 2) * camera.zoom)
    camY = height * Settings.getTileSize() - (Settings.getHeight() / 2) * camera.zoom;
  
  if (pos.y <= (Settings.getHeight() / 2) * camera.zoom)
    camY = (Settings.getHeight() / 2) * camera.zoom;
  else if (pos.y > (Settings.getHeight() / 2) * camera.zoom && pos.y < height * Settings.getTileSize() - (Settings.getHeight() / 2) * camera.zoom)
    camY = pos.y;
  
  if (camX != camera.getPos().x || camY != camera.getPos().y)
    camera.setPosition(camX, camY);
}
 
origin: jmrapp1/SpaceInvaders

public int getTileY() {
  return y * Settings.getTileSize();
}
 
origin: jmrapp1/SpaceInvaders

public int getTileX() {
  return x * Settings.getTileSize();
}
 
origin: jmrapp1/SpaceInvaders

public void resize() {
  VirtualViewport virtualViewport = new VirtualViewport(Settings.getWidth(), Settings.getHeight());  
  setVirtualViewport(virtualViewport);  
  updateViewport(Settings.getWidth(), Settings.getHeight());
}
origin: jmrapp1/SpaceInvaders

public AnimatedEntityStrip(Drawable drawable, int frames, float speed) {
  this(drawable, frames, speed, new Rectangle(0, 0, Settings.getTileSize(), Settings.getTileSize()), 0, 0);
}
 
origin: jmrapp1/SpaceInvaders

public static void instantiateSettings() {
  Settings.addSetting("width", 800);
  Settings.addSetting("height", 480);
  Settings.addSetting("tilesize", 50);
}
origin: jmrapp1/SpaceInvaders

public static int getWidth() {
  return (Integer)getSetting("width");
}
 
origin: jmrapp1/SpaceInvaders

public void resize(int width, int height) {
  VirtualViewport virtualViewport = new VirtualViewport(width, height);  
  setVirtualViewport(virtualViewport);  
  updateViewport(Settings.getWidth(), Settings.getHeight());
}
 
origin: jmrapp1/SpaceInvaders

public AnimatedEntity(Drawable drawable, float speed) {
  this(drawable, speed, new Rectangle(0, 0, Settings.getTileSize(), Settings.getTileSize()), 0, 0);
}
 
origin: jmrapp1/SpaceInvaders

public static int getHeight() {
  return (Integer)getSetting("height");
}
 
origin: jmrapp1/SpaceInvaders

public void update(EntityController entityController) {
  if (Timer.getGameTimeElapsed() - lastSpawnTime >= SPAWN_TIME_BASE - (currentRound * SPAWN_TIME_DIF_RATE)) {
    if (enemiesSpawned < totalEnemies) {
      entityController.addEntity(new BasicEnemyShip(MathUtils.random(0, Settings.getWidth() - 50), MathUtils.random(Settings.getHeight(), Settings.getHeight() * 2)));
      enemiesSpawned++;
      lastSpawnTime = Timer.getGameTimeElapsed();
      System.out.println("Added entity");
    }
  }
}
origin: jmrapp1/SpaceInvaders

public WorldObject(float x, float y, float width, float height) {
  this.pos = new Vector2(x, y);
  this.last = new Vector2(x, y);
  this.desired = new Vector2(x, y);
  this.width = width;
  this.height = height;
  boundOffset = new Rectangle(0, 0, Settings.getTileSize(), Settings.getTileSize());
}
 
origin: jmrapp1/SpaceInvaders

  public static void main (String[] arg) {
    GalacticInvaders.instantiateSettings();
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = Settings.getWidth();
    config.height = Settings.getHeight();
    new LwjglApplication(new GalacticInvaders(), config);
  }
}
origin: jmrapp1/SpaceInvaders

public void setPath(PathFinder finder, Node goal, boolean[][] walkables) {
  if (goal != null) {
    path.clear();
    path = finder.findPath(new Node((int)(pos.x / Settings.getTileSize()), (int)(pos.y / Settings.getTileSize())), goal, walkables);
    goalNode = goal;
  } else {
    goalNode = null;
    path.clear();
  }
}
 
origin: jmrapp1/SpaceInvaders

public boolean isOnScreen(AbstractEntity entity) {
  return entity.getPos().x > -entity.getWidth() && entity.getPos().x < Settings.getWidth() && entity.getPos().y > -entity.getHeight() && entity.getPos().y < Settings.getHeight();
}
origin: jmrapp1/SpaceInvaders

private void walkToNode(Node next) {
  float xOffset = (Settings.getTileSize() - width) / 2; //xOffset centers the entity in the middle of the tile
  float yOffset = (Settings.getTileSize() - height) / 2;
origin: jmrapp1/SpaceInvaders

Vector2 nextTile = normal.cpy().scl(index).scl(Settings.getTileSize()).add(newPos);
int tileX = (int)(nextTile.x / Settings.getTileSize());
int tileY = (int)(nextTile.y / Settings.getTileSize());
if (tileX == woX && tileY == woY) {
  float nX = Math.abs(normal.x);
com.jmr.ge.settingSettings

Most used methods

  • getHeight
  • getWidth
  • addSetting
  • getSetting
  • getTileSize

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTable (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now