Featured Posts

The Final Poke Game – How To Page

1. Introduction
This Pokémon version will lead you to a new kind of adventure type where you can train your own Pokémon to fight the others. Furthermore, you can catch wild Pokémon for consolidating your team or adding them into your collection. Your adventure will get more and more challenging through your ways, e.g. wild monsters will be stronger. User will play as the main character which is Blue. He has to defeat all three bosses which guard three different gates.

2. When should you apply this? (Optional)
3. Advantages & Disadvantages
Advantages

  • Training Pokémon
  • Catch wild Pokémon in specific areas in the map
  • If player’s strong enough, he can fight a boss of each map. If not, he has to train his Pokémon more
  • Store high scores on Parse.com

Disadvantages

  • Moving buttons cannot be hold while player moves his character
  • Cannot view high scores yet

4. Requirements
Phone’s Specification must be same or higher than Samsung Galaxy S3. Especially the screen resolution must be at least 720 x 1280 pixels and screen size must be at least S3 screen size. Moreover, a phone must be a smart phone and it should have 3G and run android version at least API 14.

5. Steps & Screen shots

   public void caculateActionLogic (ArrayList act) {
		for (String str : act) {
			String tmp[] = str.split("-");
			if (tmp[1].equals("attack")) {
					int damage = 0;
					damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkPhysic() * (100 - listMonster.get(Integer.parseInt(tmp[2])).getDefendPhysic() ) /100;	
					listMonster.get(Integer.parseInt(tmp[2])).setCurrentHP(listMonster.get(Integer.parseInt(tmp[2])).getCurrentHP() - damage);
					System.out.println(listMonster.get(Integer.parseInt(tmp[2])).getCurrentHP());
				
			} else if (tmp[1].equals("defend")) {
				
			} else if (tmp[1].equals("skill")) {
				temp = model.findSkillByName(tmp[2]);
					if (temp.getTarget().equals("enemy")) {
						int damage = 0;
						if (temp.getSkillType().equals("atk")) {
							damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkPhysic() * temp.getPercentAtk() /100  *( 100 -listMonster.get(Integer.parseInt(tmp[3])).getDefendPhysic() ) /100;
							listMonster.get(Integer.parseInt(tmp[3])).setCurrentHP(listMonster.get(Integer.parseInt(tmp[3])).getCurrentHP() - damage);
						} else {
							damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkMagic() * temp.getPercentAtk() /100  *( 100 -listMonster.get(Integer.parseInt(tmp[3])).getDefendMagic() ) /100;
							listMonster.get(Integer.parseInt(tmp[3])).setCurrentHP(listMonster.get(Integer.parseInt(tmp[3])).getCurrentHP() - damage);
						}
						
					} else if (temp.getTarget().equals("team")) {
						int damage = 0;
						if (temp.getSkillType().equals("atk")) {
							damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkPhysic() * temp.getPercentAtk() /100  ;
							listBattleMonster.get(Integer.parseInt(tmp[3])).setCurrentHP(listBattleMonster.get(Integer.parseInt(tmp[3])).getCurrentHP() + damage);
//							listMonster.get(Integer.parseInt(tmp[3])).setCurrentHP(listMonster.get(Integer.parseInt(tmp[3])).getCurrentHP() - damage);
						} else {
							damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkMagic() * temp.getPercentAtk() /100  ;
							listBattleMonster.get(Integer.parseInt(tmp[3])).setCurrentHP(listBattleMonster.get(Integer.parseInt(tmp[3])).getCurrentHP() + damage);
						}
					} else if (temp.getTarget().equals("aoe_enemy")) { 
						int damage = 0;
						System.out.println("check1");
						if (temp.getSkillType().equals("atk")) {
							System.out.println("check2");
//							caculateAffectedEnemy(temp.getNumberOfTarget());
							for (Monster mo :affectedMonster) {
								System.out.println("check3");
								damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkPhysic() * temp.getPercentAtk() /100  *( 100 -mo.getDefendPhysic() ) /100;
								mo.setCurrentHP(mo.getCurrentHP() - damage);
								
							}
						} else {
							for (Monster mo :affectedMonster) {
								System.out.println("check3");
								damage = listBattleMonster.get(Integer.parseInt(tmp[0])).getAtkMagic() * temp.getPercentAtk() /100  *( 100 -mo.getDefendMagic() ) /100;
								mo.setCurrentHP(mo.getCurrentHP() - damage);
								
							}
						}
						affectedMonster.removeAll(affectedMonster);
					}
					
					
			} else if (tmp[1].equals("capture")) {
				Random rad = new Random();
				int randomRandom = rad.nextInt(100 - 0 + 1) + 0;
				if (listMonster.get(Integer.parseInt(tmp[2])).isCatchAble()) {
					if (randomRandom < 30 ) {
						listMonster.get(Integer.parseInt(tmp[2])).setCurrentHP(0);
						catchMonster.add(listMonster.get(Integer.parseInt(tmp[2])));
					} else {
						
					}
				}
			}
		}
	}
   

6. Reference
A simple implementation of an LRU cache.
LRU From Stackoverflow
LRU Cache
Sound Manager
Music Manager
Preference Manager

Standard

Leave a comment