Reputation:
I'm following the example here http://www.bigerstaff.com/
I;ve added another class called Ball, and use an instance of it in this code
public class Ball extends Vector3 {
public Sprite mSprite;
public Texture mTexture;
So instead of using blockTexture and blockSprite
,
blockTexture = new Texture(Gdx.files.internal("data/block.png"));
blockSprite = new Sprite(blockTexture);
I use
ball.mTexture = new Texture(Gdx.files.internal("data/block.png")); //error
ball.mSprite = new Sprite(ball.mTexture); //error
Sorry I am new to Java, but am I missing something very basic here?
Upvotes: 0
Views: 142
Reputation: 31
Switch
ball.mSprite = new Sprite(blockTexture);
for
ball.mSprite = new Sprite(ball.mTextture);
you are not creating the blockTexture object.
Upvotes: 0