コード例 #1
0
ファイル: dropfinal.py プロジェクト: sinistersnare/JythonTalk
def main():

    cfg = LwjglApplicationConfiguration()
    cfg.title = "PyGdx";
    cfg.width = WIDTH
    cfg.height = HEIGHT

    LwjglApplication(DropGame(), cfg)
コード例 #2
0
ファイル: app.py プロジェクト: nenodias/libgdx_jython_example
def main():

    cfg = LwjglApplicationConfiguration()
    cfg.title = "PyGdx";
    cfg.width = 800
    cfg.height = 480

    LwjglApplication(PyGdx(), cfg)
コード例 #3
0
ファイル: Gdx.py プロジェクト: sinistersnare/PyGdx
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)
コード例 #4
0
                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)
コード例 #5
0
        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)