def main(): cfg = LwjglApplicationConfiguration() cfg.title = "PyGdx"; cfg.width = WIDTH cfg.height = HEIGHT LwjglApplication(DropGame(), cfg)
def main(): cfg = LwjglApplicationConfiguration() cfg.title = "PyGdx"; cfg.width = 800 cfg.height = 480 LwjglApplication(PyGdx(), cfg)
def main(): """ This shouldnt be run, it should be happening from __run__ module. """ cfg = LwjglApplicationConfiguration() cfg.title = "PyGdx"; cfg.width = 800 cfg.height = 480 LwjglApplication(PyGdx(), cfg)
for y in range(100): ty = int(Math.random() * len(splitTiles)) tx = int(Math.random() * len(splitTiles[ty])) cell = Cell() cell.setTile(StaticTiledMapTile(splitTiles[ty][tx])) layer.setCell(x, y, cell) layers.add(layer) self.renderer = OrthogonalTiledMapRenderer(self.map) def render(self): Gdx.gl.glClearColor(100.0 / 255.0, 100.0 / 255.0, 250.0 / 255.0, 1.0) Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT) self.camera.update() self.renderer.setView(self.camera) self.renderer.render() self.batch.begin() self.font.draw(self.batch, 'FPS: ' + str(Gdx.graphics.getFramesPerSecond()), 10, 20) self.batch.end() if __name__ == '__main__': config = LwjglApplicationConfiguration() config.width = 640 config.height = 480 config.title = 'Tiled Map Bench Test' config.forceExit = False LwjglApplication(TiledMapBench(), config)
fd.shape = shape fd.density = 20.0 body.createFixture(fd) shape.dispose() bd = BodyDef() bd.position.set(3, 5) bd.type = BodyType.DynamicBody bd.fixedRotation = True bd.allowSleep = False body = world.createBody(bd) shape = CircleShape() shape.setRadius(0.5) fd = FixtureDef() fd.shape = shape fd.density = 20.0 body.createFixture(fd) shape.dispose() if __name__ == '__main__': config = LwjglApplicationConfiguration() config.width = 1280 config.height = 960 config.title = 'Character Collision Test' config.forceExit = False LwjglApplication(CharacterCollision(), config)