package com.gravitygamesinteractive.kylethecaiman;
import java.awt.*;
import java.awt.image.*;
import javax.imageio.*;
import java.io.*;
public class Tile extends Rectangle{
private static final long serialVersionUID=1L;
public int id;
public int TileId;
public static int[] g1top={0,0};
public static Image tileset1groundlefttop;
public static Image tileset1groundtop;
public static Image tileset1groundrighttop;
public static Image tileset1groundleft;
public static Image tileset1ground;
public static Image tileset1groundright;
public static Image tileset1groundbotleft;
public static Image tileset1groundbot;
public static Image tileset1groundbotright;
public static Image tileset1grounddrytop;
public static Image tileset1groundsides;
public static Image tileset1trunkslim;
public static Image tileset1groundlintersectleft;
public static Image tileset1groundlintersect;
public static Image tileset1groundlintersectright;
public static Image tileset1groundrintersectleft;
public static Image tileset1groundrintersect;
public static Image tileset1groundrintersectright;
public static Image tileset1spike1;
public static Image tileset1spike2;
public static Image tileset1groundsteepslopel;
public Tile(int id,int x, int y, int TileId){
this.id=id;
this.x=x;
this.y=y;
this.TileId=TileId;
this.width=16;
this.height=16;
tileset1groundlefttop = resources.ResourceLoader.getImage("tileset1_1.png");
tileset1groundtop = resources.ResourceLoader.getImage("tileset1_2.png");
tileset1groundrighttop = resources.ResourceLoader.getImage("tileset1_3.png");
tileset1groundleft = resources.ResourceLoader.getImage("tileset1_4.png");
tileset1ground = resources.ResourceLoader.getImage("tileset1_5.png");
tileset1groundright = resources.ResourceLoader.getImage("tileset1_6.png");
tileset1groundbotleft = resources.ResourceLoader.getImage("tileset1_7.png");
tileset1groundbot = resources.ResourceLoader.getImage("tileset1_8.png");
tileset1groundbotright = resources.ResourceLoader.getImage("tileset1_9.png");
tileset1grounddrytop = resources.ResourceLoader.getImage("tileset1_10.png");
tileset1groundsides = resources.ResourceLoader.getImage("tileset1_11.png");
tileset1trunkslim = resources.ResourceLoader.getImage("tileset1_12.png");
tileset1groundlintersectleft = resources.ResourceLoader.getImage("tileset1_13.png");
tileset1groundlintersect = resources.ResourceLoader.getImage("tileset1_14.png");
tileset1groundlintersectright = resources.ResourceLoader.getImage("tileset1_15.png");
tileset1groundrintersectleft = resources.ResourceLoader.getImage("tileset1_14.png");
tileset1groundrintersect = resources.ResourceLoader.getImage("tileset1_14.png");
tileset1groundrintersectright = resources.ResourceLoader.getImage("tileset1_14.png");
tileset1spike1= resources.ResourceLoader.getImage("tileset1_19.png");
tileset1spike2 = resources.ResourceLoader.getImage("tileset1_20.png");
tileset1groundsteepslopel = resources.ResourceLoader.getImage("tileset1_21.png");
}
public void tick(){
if(!Character.isJumping && !Character.isTouchingFloor){
//y=y-Character.fallspeed;
//this.y=y-Character.fallspeed;
}
if(Character.isJumping){
if(Character.jumpCount>=Character.jumpHeight){
//y=y-Character.fallspeed;
//this.y=y-Character.fallspeed;
}else{
//y=y+Character.fallspeed;
//this.y=y+Character.fallspeed;
}
}
//x=x-Component.dir;
//this.x=x-Component.dir;
//System.out.println(this.x);
//System.out.println(this.y);
}
public void paint(Graphics g){
g.setColor(Color.red);
if (TileId==1){
g.drawImage(tileset1groundlefttop,x-Component.sx,y-Component.sy,null);
}
if (TileId==2){
g.drawImage(tileset1groundtop,x-Component.sx,y-Component.sy,null);
}
if (TileId==3){
g.drawImage(tileset1groundrighttop,x-Component.sx,y-Component.sy,null);
}
if (TileId==4){
g.drawImage(tileset1groundleft,x-Component.sx,y-Component.sy,null);
}
if (TileId==5){
g.drawImage(tileset1ground,x-Component.sx,y-Component.sy,null);
}
if (TileId==6){
g.drawImage(tileset1groundright,x-Component.sx,y-Component.sy,null);
}
if (TileId==7){
g.drawImage(tileset1groundbotleft,x-Component.sx,y-Component.sy,null);
}
if (TileId==8){
g.drawImage(tileset1groundbot,x-Component.sx,y-Component.sy,null);
}
if (TileId==9){
g.drawImage(tileset1groundbotright,x-Component.sx,y-Component.sy,null);
}
if (TileId==10){
g.drawImage(tileset1grounddrytop,x-Component.sx,y-Component.sy,null);
}
if (TileId==11){
g.drawImage(tileset1groundsides,x-Component.sx,y-Component.sy,null);
}
if (TileId==12){
g.drawImage(tileset1trunkslim,x-Component.sx,y-Component.sy,null);
}
if (TileId==13){
g.drawImage(tileset1groundlintersectleft,x-Component.sx,y-Component.sy,null);
}
if (TileId==14){
g.drawImage(tileset1groundlintersect,x-Component.sx,y-Component.sy,null);
}
if (TileId==15){
g.drawImage(tileset1groundlintersectright,x-Component.sx,y-Component.sy,null);
}
if (TileId==16){
g.drawImage(tileset1groundrintersectleft,x-Component.sx,y-Component.sy,null);
}
if (TileId==17){
g.drawImage(tileset1groundrintersect,x-Component.sx,y-Component.sy,null);
}
if (TileId==18){
g.drawImage(tileset1groundrintersectright,x-Component.sx,y-Component.sy,null);
}
if (TileId==19){
g.drawImage(tileset1spike1,x-Component.sx,y-Component.sy,null);
}
if (TileId==20){
g.drawImage(tileset1spike2,x-Component.sx,y-Component.sy,null);
}
if (TileId==21){
g.drawImage(tileset1groundsteepslopel,x-Component.sx,y-Component.sy,null);
}
}
}