iMackshun

RPGLeadCharacter.java

Sep 26th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. package com.iMackshun.Games.RPGEngineDroid.RPGObjects;
  2.  
  3. public class RPGLeadCharacter {
  4.     int X;
  5.     int Y;
  6.     int RPGX;
  7.     int RPGY;
  8.     Boolean Moving = false;
  9.     //Constructor
  10.     public RPGLeadCharacter(int X, int Y){
  11.         this.X = X;
  12.         this.Y = Y;
  13.     }
  14.    
  15.     public void update(){
  16.         RPGX = X/32;
  17.         RPGY = (720 - Y)/32;
  18.         if(X%32 == 0 && Y%32 == 0){
  19.             Moving = false;
  20.         }
  21.     }
  22.     //Personal Methods
  23.     public void MoveUp(){
  24.         if(Moving == false){
  25.             Moving = true;
  26.             for(int i = 0; i < 32; i++){
  27.                 Y++;
  28.             }
  29.         }
  30.     }
  31.     public void MoveDown(){
  32.         if(Moving == false){
  33.             Moving = true;
  34.             for(int i = 0; i < 32; i++){
  35.                 Y--;
  36.             }
  37.         }
  38.     }
  39.     public void MoveLeft(){
  40.         if(Moving == false){
  41.             Moving = true;
  42.             for(int i = 0; i < 32; i++){
  43.                 X--;
  44.             }
  45.         }
  46.    
  47.     }
  48.     public void MoveRight(){
  49.         if(Moving == false){
  50.             Moving = true;
  51.             for(int i = 0; i < 32; i++){
  52.                 X++;
  53.             }
  54.         }
  55.     }
  56.     //Getters and Setters
  57.     public int getX() {
  58.         return X;
  59.     }
  60.     public int getY() {
  61.         return Y;
  62.     }
  63.     public int getRPGX() {
  64.         return RPGX;
  65.     }
  66.     public int getRPGY() {
  67.         return RPGY;
  68.     }
  69.     public void setX(int x) {
  70.         X = x;
  71.     }
  72.     public void setY(int y) {
  73.         Y = y;
  74.     }
  75.     public void setRPGX(int rPGX) {
  76.         RPGX = rPGX;
  77.     }
  78.     public void setRPGY(int rPGY) {
  79.         RPGY = rPGY;
  80.     }
  81.    
  82. }
Advertisement
Add Comment
Please, Sign In to add comment