Introducing LibGDX!

Updated on July 19, 2014 in  [R] Scripts
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
3 on July 16, 2014

Hey Guys if any of you want to start using something i program in called libGDX .
It is a really fun library that includes a ton of awesome features. To start go on youtube to see how to import the
libs and to start off type in this line of code!

 package com.neet.main;
 import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
 import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
 public class Main {
 public static void main(String[] args) {
 LwjglApplicationConfiguration cfg =
 new LwjglApplicationConfiguration();
 cfg.title = "Asteroids";
 cfg.width = 500;
 cfg.height = 400;
 cfg.useGL20 = false;
 cfg.resizable = false;
 new LwjglApplication(new Game(), cfg);
 }
 }
 

and you will also need this!
 package com.neet.main;
 import com.badlogic.gdx.ApplicationListener;
 import com.badlogic.gdx.Gdx;
 import com.badlogic.gdx.graphics.GL10;
 import com.badlogic.gdx.graphics.OrthographicCamera;
 import com.neet.managers.GameInputProcessor;
 import com.neet.managers.GameKeys;
 import com.neet.managers.GameStateManager;
 import com.neet.managers.Jukebox;
 public class Game implements ApplicationListener {
 public static int WIDTH;
 public static int HEIGHT;
 public static OrthographicCamera cam;
 private GameStateManager gsm;
 public void create() {
 WIDTH = Gdx.graphics.getWidth();
 HEIGHT = Gdx.graphics.getHeight();
 cam = new OrthographicCamera(WIDTH, HEIGHT);
 cam.translate(WIDTH / 2, HEIGHT / 2);
 cam.update();
 Gdx.input.setInputProcessor(
 new GameInputProcessor()
 )
 gsm = new GameStateManager();
 }
 public void render() {
 // clear screen to black
 Gdx.gl.glClearColor(0, 0, 0, 1);
 Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
 gsm.update(Gdx.graphics.getDeltaTime());
 gsm.draw();
 GameKeys.update();
 }
 public void resize(int width, int height) {}
 public void pause() {}
 public void resume() {}
 public void dispose() {}
 }
 

  • Liked by
  • Brackeys
Reply
0 on July 16, 2014

Hmm, looks like a very fun and accessible Java framework 🙂

  • Liked by
Reply
Cancel
1 on July 18, 2014

Thanks for sharing.
Just wondering, what type of things can you do with it?

Helpful
on July 19, 2014

There are many awesome ways you could do with libGDX! You can make physic engines, platformer, shooters and so much more! I recommend going on to youtube or reading the libGDX forums on how to get started with libGDX! Hope i could help! 🙂

Show more replies
  • Liked by
Reply
Cancel