Git Product home page Git Product logo

libgdx-demo-superjumper's Introduction

libgdx-demo-superjumper's People

Contributors

badlogic avatar crykn avatar intrigus avatar johnnyapol avatar mobidevelop avatar nathansweet avatar obigu avatar piotr-j avatar tom-ski avatar waynedyck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libgdx-demo-superjumper's Issues

robovm-rt robovm-cocoatouch

"robovmVersion":"2.1.0" ,gradle build could not fin robovm-rt, robovm-cocoatouch.
I change the code like this:
compile "org.robovm:robovm-rt:1.8.0"
compile "org.robovm:robovm-cocoatouch:1.8.0"
then gradle build success.

HelpScreen (1->5) All in one.

I have collect 5 class HelpScreen1->HelpScreen5 in class HelpScreen
I wish this code i may be useful for you.

public class HelpScreen extends ScreenAdapter {
SuperJumper game;

OrthographicCamera guiCam;
Rectangle nextBounds;
Vector3 touchPoint;
String files[] = new String[]{"data/help1.png","data/help2.png","data/help3.png","data/help4.png","data/help5.png"};
Texture[] helpImages = new Texture[5];
TextureRegion[] helpRegions = new TextureRegion[5];
int current;

public HelpScreen(SuperJumper game) {
    // TODO Auto-generated constructor stub
    this.game = game;

    guiCam = new OrthographicCamera();
    guiCam.setToOrtho(false, 320, 480);
    nextBounds = new Rectangle(320 - 64, 0, 64, 64);
    touchPoint = new Vector3();
    for(int i = 0; i < 5; i++){
        helpImages[i] = Assets.loadTexture(files[i]);
        helpRegions[i] = new TextureRegion(helpImages[i],0,0,320,480);
    }
    current = 0;
}

public void update(){
    if (Gdx.input.justTouched()){
        guiCam.unproject(touchPoint.set(Gdx.input.getX(),Gdx.input.getY(),0));

        if (nextBounds.contains(touchPoint.x, touchPoint.y)) {
            Assets.playSound(Assets.clickSound);
            current ++;
            if ( current == 4){
                current = 0;
                game.setScreen(new MainMenuScreen(game));
            }
        }
    }
}

public void draw(){
    GL20 gl = Gdx.gl;
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

    guiCam.update();
    game.batcher.setProjectionMatrix(guiCam.combined);
    game.batcher.disableBlending();
    game.batcher.begin();
    game.batcher.draw(helpRegions[current], 0, 0);
    game.batcher.end();

    game.batcher.enableBlending();
    game.batcher.begin();
    game.batcher.draw(Assets.arrow, 320, 0, -64,64);
    game.batcher.end();
}

@Override
public void render(float delta) {
    // TODO Auto-generated method stub
    super.render(delta);
    update();
    draw();
}

@Override
public void dispose() {
    // TODO Auto-generated method stub
    super.dispose();
    for(int i = 0; i < 5; i ++){
        helpImages[i].dispose();
    }
}

}

Why not use AssetManager class?

As stated in the LibGdx Wiki, AssetManager is the recommended way to load the assets. Then why not use it in this project as well?

aidl is missing

Hey. I just cloned this project and faced with below error:

Error:Execution failed for task ':android:compileDebugAidl'.
> java.lang.IllegalStateException: aidl is missing

I'm using Android studio 2.1.1.
I must launch it as soon as possible So please give me a help.

Specify license

What's the license covering this project?
If nothing is specified, then it legally defaults to "all rights reserved".
Which means nothing useful can be done with it.

In case it should still be decided, what about using

It would align it with what LibGDX uses. Basically,

  • do what you want with the code
  • don't hold the author(s) liable if something breaks
  • give credit to the author(s) as the original creators

Why not combine the HelpScreen1-5 in One?

int fileIndex;
    public HelpScreen (SuperJumper game,int fileIndex) {
    this.game = game;
    this.fileIndex=fileIndex;
    guiCam = new OrthographicCamera();
    guiCam.setToOrtho(false, 320, 480);
    nextBounds = new Rectangle(320 - 64, 0, 64, 64);
    touchPoint = new Vector3();
    helpImage = Assets.loadTexture("data/help"+fileIndex+".png");
    helpRegion = new TextureRegion(helpImage, 0, 0, 320, 480);
}

public void update () {
    if (Gdx.input.justTouched()) {
        guiCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0));

        if (nextBounds.contains(touchPoint.x, touchPoint.y)) {
            Assets.playSound(Assets.clickSound);
            if(fileIndex==5){
                game.setScreen(new MainMenuScreen(game));
            }
            else{
                game.setScreen(new HelpScreen(game,++fileIndex));
            }
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.