Advertisement
Guest User

Untitled

a guest
Jan 28th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. package com.shootthefacedontdie.game.GameActors;
  2.  
  3. import com.badlogic.gdx.Gdx;
  4. import com.badlogic.gdx.audio.Music;
  5. import com.badlogic.gdx.graphics.Texture;
  6. import com.badlogic.gdx.graphics.g2d.Sprite;
  7. import com.badlogic.gdx.math.Rectangle;
  8.  
  9. public class Character extends Rectangle {
  10.     private Sprite sprite;
  11.     private Texture texture;
  12.     private Music sound;
  13.  
  14.     public Character(String directory) {
  15.         texture = new Texture(directory);
  16.         sprite = new Sprite(texture);
  17.         sprite.setSize(texture.getWidth(), texture.getHeight());
  18.     }
  19.  
  20.     public Texture getTexture() {
  21.         return texture;
  22.     }
  23.  
  24.     public Sprite getSprite() {
  25.         return sprite;
  26.     }
  27.  
  28.     public Music getSound()
  29.     {
  30.         return sound;
  31.     }
  32.  
  33.     public void setSound(String directory) {
  34.         sound = Gdx.audio.newMusic(Gdx.files.internal(directory));
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement