Back to project page diploma-assignment.
The source code is released under:
MIT License
If you think the Android project diploma-assignment listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.me.battlescreen; /*from w w w . ja v a2 s .c om*/ import java.util.ArrayList; import java.util.List; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; //int[] id_list logic position - purpose //0-(number of frames walk) //1-(number of frames fight) //2-(number of frames die) //3-InitialX //4-InitialY //5-height //6-attack //7-health public abstract class getTextures { public static void getIdItemsRampart(final List<int[]> id_list,int height,int[] upgraded) { if(upgraded[0]==0) id_list.add(new int[]{6,6,6,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.CENTAUR_HEIGHT),5,8*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{6,7,6,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.CENTAUR_HEIGHT),7,10*Constants.HEALTH_PLAYER_MONSTERS}); if(upgraded[1]==0) id_list.add(new int[]{8,8,4,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.DWARF_HEIGHT),10,20*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{8,8,4,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.DWARF_HEIGHT),14,25*Constants.HEALTH_PLAYER_MONSTERS}); if(upgraded[2]==0) id_list.add(new int[]{8,6,3,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.ELF_HEIGHT),12,15*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{8,8,3,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.ELF_HEIGHT),18,22*Constants.HEALTH_PLAYER_MONSTERS}); if(upgraded[3]==0) id_list.add(new int[]{7,8,6,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.PEGASUS_HEIGHT),15,30*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{7,7,6,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.PEGASUS_HEIGHT),20,40*Constants.HEALTH_PLAYER_MONSTERS}); if(upgraded[4]==0) id_list.add(new int[]{8,6,7,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.DENDROIDGUARD_HEIGHT),22,55*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{8,6,7,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.DENDROIDGUARD_HEIGHT),28,65*Constants.HEALTH_PLAYER_MONSTERS}); if(upgraded[5]==0) id_list.add(new int[]{8,7,7,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.UNICORN_HEIGHT),25,90*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{7,7,7,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.UNICORN_HEIGHT),30,110*Constants.HEALTH_PLAYER_MONSTERS}); if(upgraded[6]==0) id_list.add(new int[]{4,8,4,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.DRAGON_HEIGHT),40,180*Constants.HEALTH_PLAYER_MONSTERS}); else id_list.add(new int[]{4,8,9,(int)Constants.MONSTER_X_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.DRAGON_HEIGHT),50,250*Constants.HEALTH_PLAYER_MONSTERS}); } public static void getWalkingRampart(final ArrayList<Texture> walk,int[] upgraded) { String[] strings={"centaur_w","dwarf_w","elf_w","pegasus_w","dendroidguard_w","unicorn_w","dragon_w"}; for(int i=0;i<7;i++){ if(upgraded[i]==1){ strings[i]=strings[i]+"_u"; } } for(int j=0;j<7;j++){ walk.add(new Texture(Gdx.files.internal("data/walk/"+strings[j]+".png"))); } } public static void getDyingRampart(final ArrayList<Texture> die,int[] upgraded) { String[] strings={"centaur_d","dwarf_d","elf_d","pegasus_d","dendroidguard_d","unicorn_d","dragon_d"}; for(int i=0;i<7;i++){ if(upgraded[i]==1){ strings[i]=strings[i]+"_u"; } } for(int j=0;j<7;j++){ die.add(new Texture(Gdx.files.internal("data/die/"+strings[j]+".png"))); } } public static void getAttackingRampart(final ArrayList<Texture> fight,int[] upgraded) { String[] strings={"centaur_f","dwarf_f","elf_f","pegasus_f","dendroidguard_f","unicorn_f","dragon_f"}; for(int i=0;i<7;i++){ if(upgraded[i]==1){ strings[i]=strings[i]+"_u"; } } for(int j=0;j<7;j++){ fight.add(new Texture(Gdx.files.internal("data/fight/"+strings[j]+".png"))); } } public static void getThumbnailsRampart(ArrayList<Texture> id_thumbnail_list,int[] upgraded) { String[] strings={"centaur_t","dwarf_t","elf_t","pegasus_t","dendroidguard_t","unicorn_t","dragon_t"}; for(int i=0;i<7;i++){ if(upgraded[i]==1){ strings[i]=strings[i]+"_u"; } } for(int j=0;j<7;j++){ id_thumbnail_list.add(new Texture(Gdx.files.internal("data/thumbnails/"+strings[j]+".png"))); } id_thumbnail_list.add(new Texture(Gdx.files.internal("data/thumbnails/ballista_button_t.png"))); } public static void getIdItemsNecro(final List<int[]> id_list,int height) { id_list.add(new int[]{6,8,6,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.SKELETON_HEIGHT),8,6*Constants.HEALTH_COMPUTER_MONSTERS}); id_list.add(new int[]{8,6,8,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.ZOMBIE_HEIGHT),12,15*Constants.HEALTH_COMPUTER_MONSTERS}); id_list.add(new int[]{4,8,7,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.WIGTH_HEIGHT),15,18*Constants.HEALTH_COMPUTER_MONSTERS}); id_list.add(new int[]{4,6,7,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.VAMPIRE_HEIGHT),20,30*Constants.HEALTH_COMPUTER_MONSTERS}); id_list.add(new int[]{8,4,7,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.LICH_HEIGHT),25,30*Constants.HEALTH_COMPUTER_MONSTERS}); id_list.add(new int[]{8,8,6,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.BLACKKNIGHT_HEIGHT),32,120*Constants.HEALTH_COMPUTER_MONSTERS}); id_list.add(new int[]{5,7,8,(int)Constants.MONSTER_X_COMPUTER_OFFSET,(int)(height*Constants.MONSTER_OFFSET),(int)(height*Constants.BONEDRAGON_HEIGHT),40,150*Constants.HEALTH_COMPUTER_MONSTERS}); } public static void getWalkingNecro(final ArrayList<Texture> walk) { walk.add(new Texture(Gdx.files.internal("data/walk/skeleton_w.png"))); walk.add(new Texture(Gdx.files.internal("data/walk/zombie_w.png"))); walk.add(new Texture(Gdx.files.internal("data/walk/wigth_w.png"))); walk.add(new Texture(Gdx.files.internal("data/walk/vampire_w.png"))); walk.add(new Texture(Gdx.files.internal("data/walk/lich_w.png"))); walk.add(new Texture(Gdx.files.internal("data/walk/blackKnight_w.png"))); walk.add(new Texture(Gdx.files.internal("data/walk/boneDragon_w.png"))); } public static void getDyingNecro(final ArrayList<Texture> die) { die.add(new Texture(Gdx.files.internal("data/die/skeleton_d.png"))); die.add(new Texture(Gdx.files.internal("data/die/zombie_d.png"))); die.add(new Texture(Gdx.files.internal("data/die/wigth_d.png"))); die.add(new Texture(Gdx.files.internal("data/die/vampire_d.png"))); die.add(new Texture(Gdx.files.internal("data/die/lich_d.png"))); die.add(new Texture(Gdx.files.internal("data/die/blackKnight_d.png"))); die.add(new Texture(Gdx.files.internal("data/die/boneDragon_d.png"))); } public static void getAttackingNecro(final ArrayList<Texture> fight) { fight.add(new Texture(Gdx.files.internal("data/fight/skeleton_f.png"))); fight.add(new Texture(Gdx.files.internal("data/fight/zombie_f.png"))); fight.add(new Texture(Gdx.files.internal("data/fight/wigth_f.png"))); fight.add(new Texture(Gdx.files.internal("data/fight/vampire_f.png"))); fight.add(new Texture(Gdx.files.internal("data/fight/lich_f.png"))); fight.add(new Texture(Gdx.files.internal("data/fight/blackKnight_f.png"))); fight.add(new Texture(Gdx.files.internal("data/fight/boneDragon_f.png"))); } }