World world = new World(); World spy = Mockito.spy(world); Mockito.doNothing().when(spy).methodToMock();
/** Construct a world object. * @param gravity the world gravity vector. * @param doSleep improve performance by not simulating inactive bodies. */ public World (Vector2 gravity, boolean doSleep) { world = new org.jbox2d.dynamics.World(tmp.set(gravity.x, gravity.y)); world.setAllowSleep(doSleep); }
public Scene() { world = new World(new Vec2(0, -9.8f)); initAxis(); initReel(); joinReelToAxis(); initBalls(); lastCalculated = System.currentTimeMillis(); }
@Override public World createWorld(Vec2 gravity) { return new World(gravity); } }
@Override public void setupTest(int testNum) { World w = new World(new Vec2(0, -10)); world.setupWorld(w); }
public class GameScreen extends Screen{ MYActivityListener mL; public GameScreen(Game game) { super(game); mL = (MyActivityListener)game; world = new World(); clueLetters = new String[10]; levelNo = SettingsObject.levelUnlock; getWord(); mL.showInterstitial(); } }
public Blobs() { super("Blobs :) - By Chris Tanaka"); setVisible(true); setResizable(false); setSize(1000, 1000); setIgnoreRepaint(true); setDefaultCloseOperation(EXIT_ON_CLOSE); World world = new World(); getContentPane().add(world); this.addKeyListener(world); setVisible(true); }
public class WorldTest2{ World worldObj; public World(){ worldObj = new World(); } public World getWorld(){ //Now call this in MyMouseAdapter Class return worldObj; // instead of creating new Object of World } }
public class PolygonArtMaker{ public static void main(String [] args){ World wRef = new World( ); ArtisticTurtle tRef = new ArtisticTurtle ( wRef ); // this is just some random number I chose, not sure where you are supposed to get this value. int num = 7; // here is where the magic happens - call the function in the other class tRef.pentagon(num); } }
public World deserializeWorld(PbWorld pbWorld) { World world = new World(pbToVec(pbWorld.getGravity()));
Map<String, World> WorldsByName = new HashMap<String, World>(); private void sample(String[] inserted) { // Map<String, World> WorldsByName = new HashMap<String, World>(); WorldsByName.put(inserted[1], new World() {...
public static void main(String[] args){ SwingUtilities.invokeLater(new Runnable(){ @Override public void run() { new World("Hej", "/resources/stackoverflow5.png", 1024, 768); } }); }
public void addCountries(Contry[] contry){ World[] worlds=new World[contry.length]; World world=null; for (int i=0;i<contry.length;i++) { world=new World(); world.setCountry(contry[i].getCountry()); worlds[i]=world; } }
World world = new World(0x20A0600000000000L); System.out.println(world); world.setCell(1, 1, true); // Aha, 'world' is being altered System.out.println(world);
public WorldTest2() { World worldObj = new World(); worldObj.addMouseListener(new MyMouseAdapter()); }
main(String[] args) { World world = new World(); // setup different fields world.prepare(); // modify some fields world.calculate(); System.out.println(world.getResult()); // or world.printResult(); }
private void createWorld() { if (world == null) { //分别设置水平方向 垂直方向的重力加速度 //水平方向为0 垂直方向为10.0 更准确取值应该为9.8 比现实世界稍大 world = new World(new Vec2(0, 10.0f)); //巧妙的方法在边缘加上了刚体 updateTopAndBottomBounds(); updateLeftAndRightBounds(); } }
// Create player and world Player p = new Player(); World w = new World(); // Add player to world w.add(p); // Update everything w.update(); // Render everything w.render();
Food foo1 = new Food(); Food foo2 = new Food(); Food foo3 = new Food(); World world = new World(); world.add(foo1, ...); //Be sure to place each object in a distinct position so you can see each one. world.add(foo2, ...); world.add(foo3, ...); //Now delete one. foo1.killFood(); //one of th ethree should go away.