Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.shootthefacedontdie.game.GameActors;
- import com.badlogic.gdx.Gdx;
- import com.badlogic.gdx.audio.Music;
- import com.badlogic.gdx.graphics.Texture;
- import com.badlogic.gdx.graphics.g2d.Sprite;
- import com.badlogic.gdx.math.Rectangle;
- public class Character extends Rectangle {
- private Sprite sprite;
- private Texture texture;
- private Music sound;
- public Character(String directory) {
- texture = new Texture(directory);
- sprite = new Sprite(texture);
- sprite.setSize(texture.getWidth(), texture.getHeight());
- }
- public Texture getTexture() {
- return texture;
- }
- public Sprite getSprite() {
- return sprite;
- }
- public Music getSound()
- {
- return sound;
- }
- public void setSound(String directory) {
- sound = Gdx.audio.newMusic(Gdx.files.internal(directory));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement