Guest User

Entity.java

a guest
Mar 30th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. package me.willchill.game.entity;
  2.  
  3. import java.io.FileInputStream;
  4. import java.io.IOException;
  5.  
  6. import org.newdawn.slick.opengl.Texture;
  7. import org.newdawn.slick.opengl.TextureLoader;
  8.  
  9. public class Entity {
  10.    
  11.     public int x;
  12.     public int y;
  13.     public Texture texture = null;
  14.    
  15.     public Entity(String path, int x, int y){
  16.         this.x = x;
  17.         this.y = y;
  18.         try {
  19.             texture = TextureLoader.getTexture("PNG", new FileInputStream("res/player.png"));
  20.         } catch (IOException e) {
  21.             e.printStackTrace();
  22.         }
  23.     }
  24.    
  25.     public void move(int xa, int ya){
  26.         this.x += xa;
  27.         this.y += ya;
  28.     }
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment