Tabnine Logo
Platform.tick
Code IndexAdd Tabnine to your IDE (free)

How to use
tick
method
in
playn.core.Platform

Best Java code snippets using playn.core.Platform.tick (Showing top 3 results out of 315)

origin: threerings/playn

/**
 * Returns the number of milliseconds that have elapsed since the game started.
 */
public static int tick() {
 return platform.tick();
}
origin: playn/playn

 private void onFrame () {
  int nextUpdate = this.nextUpdate;
  int updateTick = plat.tick();
  if (updateTick >= nextUpdate) {
   int updateRate = this.updateRate;
   int updates = 0;
   while (updateTick >= nextUpdate) {
    nextUpdate += updateRate;
    updates++;
   }
   this.nextUpdate = nextUpdate;
   int updateDt = updates*updateRate;
   updateClock.tick += updateDt;
   updateClock.dt = updateDt;
   update(updateClock);
  }

  int paintTick = plat.tick();
  paintClock.dt = paintTick - paintClock.tick;
  paintClock.tick = paintTick;
  paintClock.alpha = 1 - (nextUpdate - paintTick) / (float)updateRate;
  paint(paintClock);
 }
}
origin: io.playn/playn-core

 private void onFrame () {
  int nextUpdate = this.nextUpdate;
  int updateTick = plat.tick();
  if (updateTick >= nextUpdate) {
   int updateRate = this.updateRate;
   int updates = 0;
   while (updateTick >= nextUpdate) {
    nextUpdate += updateRate;
    updates++;
   }
   this.nextUpdate = nextUpdate;
   int updateDt = updates*updateRate;
   updateClock.tick += updateDt;
   updateClock.dt = updateDt;
   update(updateClock);
  }

  int paintTick = plat.tick();
  paintClock.dt = paintTick - paintClock.tick;
  paintClock.tick = paintTick;
  paintClock.alpha = 1 - (nextUpdate - paintTick) / (float)updateRate;
  paint(paintClock);
 }
}
playn.corePlatformtick

Javadoc

Returns the number of milliseconds that have elapsed since the game started.

Popular methods of Platform

  • log
    Returns the Log service.
  • graphics
    Returns the Graphics service.
  • assets
    Returns the Assets service.
  • input
    Returns the Input service.
  • invokeLater
  • exec
    Returns the Exec service.
  • json
    Returns the Json service.
  • storage
    Returns the Storage storage service.
  • time
    Returns the current time, as a double value in millis since January 1, 1970, 00:00:00 GMT. This is e
  • type
    Returns the platform Platform.Type.
  • net
    Returns the Net service.
  • reportError
    Called when a backend (or other framework code) encounters an exception that it can recover from, bu
  • net,
  • reportError,
  • setPropagateEvents,
  • audio,
  • dispatchEvent,
  • keyboard,
  • mouse,
  • openURL,
  • pointer

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now