Created
August 12, 2014 02:43
-
-
Save machaka/69f32f993e5f0e89db6a to your computer and use it in GitHub Desktop.
tarea de pokemons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pokemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
</project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="MagicentoSettings"> | |
<option name="pathToMage" value="$PROJECT_DIR$/app/Mage.php" /> | |
<option name="pathToMage" value="$PROJECT_DIR$/app/Mage.php" /> | |
<option name="enabled" value="false" /> | |
</component> | |
</project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectRootManager" version="2" /> | |
</project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
<module fileurl="file://$PROJECT_DIR$/.idea/pokemon.iml" filepath="$PROJECT_DIR$/.idea/pokemon.iml" /> | |
</modules> | |
</component> | |
</project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="WEB_MODULE" version="4"> | |
<component name="NewModuleRootManager"> | |
<content url="file://$MODULE_DIR$" /> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
</component> | |
</module> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<component name="DependencyValidationManager"> | |
<state> | |
<option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
</state> | |
</component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="VcsDirectoryMappings"> | |
<mapping directory="" vcs="" /> | |
</component> | |
</project> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by roberto on 11/08/14. | |
*/ | |
/*function Pokemon(nombre, vida, ataque) | |
{ | |
var estructuraPokemon = | |
{ | |
nombre: nombre, | |
vida: vida, | |
ataque: ataque, | |
datos: { | |
tipo: "Tierra", | |
debilidad: "Fuego" | |
} | |
}; | |
return estructuraPokemon; | |
} | |
console.log(Pokemon('Pikachu','100', '70')); | |
*/ | |
function Pokemon(nombre, vida, ataque, defensa, grito) | |
{ | |
this.nombre = nombre; | |
this.vida = vida; | |
this.ataque = ataque; | |
this.grito = grito | |
this.defensa = defensa; | |
this.gritar = function () | |
{ | |
alert(this.grito); | |
} | |
} | |
var pokemonUno = new Pokemon('pikachu', 100, 35, 85, 'Pika!'); | |
var pokemonDos = new Pokemon('charmander', 100, 38, 80, 'Char!!!'); | |
window.onload = function() | |
{ | |
var nombrePokemonUno = document.getElementById('pokemon-name-1'); | |
var ataquePokemonUno = document.getElementById('pokemon-ataque-1'); | |
var vidaPokemonUno = document.getElementById('pokemon-vida-1'); | |
document.getElementById('pokemon-image-1').src='static/img/' + pokemonUno.nombre + '.jpg'; | |
nombrePokemonUno.innerText = pokemonUno.nombre; | |
ataquePokemonUno.innerText = pokemonUno.ataque; | |
vidaPokemonUno.innerText = pokemonUno.vida; | |
var nombrePokemonDos = document.getElementById('pokemon-name-2'); | |
var ataquePokemonDos = document.getElementById('pokemon-ataque-2'); | |
var vidaPokemonDos = document.getElementById('pokemon-vida-2'); | |
var imagePokemonDos = document.getElementById('pokemon-image-2'); | |
document.getElementById('pokemon-image-2').src='static/img/' + pokemonDos.nombre + '.jpg'; | |
nombrePokemonDos.innerText = pokemonDos.nombre; | |
ataquePokemonDos.innerText = pokemonDos.ataque; | |
vidaPokemonDos.innerText = pokemonDos.vida; | |
}; | |
function batalla() | |
{ | |
var turno = 0; | |
while(pokemonUno.vida > 0 || pokemonDos.vida > 0) { | |
//Turno pokemon uno | |
if (turno == 0) { | |
pokemonDos.vida = pokemonDos.vida - pokemonUno.ataque; | |
alert("Golpea " + pokemonUno.nombre ); | |
alert(pokemonDos.nombre + " le queda un total de vida de: " + pokemonDos.vida); | |
turno = 1; | |
} else { | |
pokemonUno.vida = pokemonUno.vida - pokemonDos.ataque; | |
alert("Golpea " + pokemonDos.nombre); | |
alert(pokemonUno.nombre + " le queda un total de vida de: " + pokemonUno.vida); | |
turno = 0; | |
} | |
if (pokemonUno.vida <= 0) { | |
alert("!!!Gano:++ " + pokemonDos.nombre); | |
document.getElementById('pokemon-player-1').style.display = 'none'; | |
break; | |
} else if (pokemonDos.vida <= 0) { | |
alert("!!!Gano " + pokemonUno.nombre); | |
document.getElementById('pokemon-player-2').style.display = 'none'; | |
break; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>POKEMON</title> | |
<meta charset="UTF-8"> | |
<script type="text/javascript" src="js/pokemon.js"></script> | |
</head> | |
<body> | |
<p> | |
<h1>Batalla Pokemon!</h1> | |
<div id="pokemon-player-1"> | |
<div id="pokemon-name-1"></div> | |
<div id="pokemon-ataque-1"></div> | |
<div id="pokemon-vida-1"></div> | |
<img id="pokemon-image-1"></div> | |
</div> | |
-------------------------------- | |
<div id="pokemon-player-2"> | |
<div id="pokemon-name-2"></div> | |
<div id="pokemon-ataque-2"></div> | |
<div id="pokemon-vida-2"></div> | |
<img id="pokemon-image-2"> | |
</div> | |
<input type="button" value="PELEA" onclick="batalla();"> | |
</p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
���� JFIF �� � ("%$1!%)../.384,7(-.+ | |
4& &44,44,,,,7-844,,/-4,,,,,.,,,,,,,,4,,,,,,/,,,,,,,,,�� � � �� �� I !1AQaq�"2�#3BRbr���4C����$Ss��5Tcd������� �� 8 !1AQaq��"2�������3BR4#r�$�� ? �4�P | |
@( ��P | |
@( ��P | |
@( ��P | |
@( �����( | |
���g�/u Э�����)�5��zT�jI/e:5*{��ސ�O���nx�|#�lZ'�|�-l˗��f�����U���Y�Ϣ$��[�mj������Rʽ=e����dm�.�Io*J��Nq�G5=�Z�E7� ��P | |
@( ��P | |
@( ���ލ�����s��A�$=�u��AXN�i��O B��b��s�..o�o��X�� U���{�ݼ��۔�.�� oR��eE{U�}�B��QB���U�)<�����FJ��PO`VN��ͼ���ɱ�"r�|u�"�,��kw��=ӡ�u��z�����m�Et�%A�%Q�ȉ�;T���k�w߃�j����v�l��@( ��P | |
@( ��P | |
@(��N�jhs%��7$���$��X`*��R�����>ʥېN��|�r-vD�l�D�rgH( �5i�e�D�d�$c����z�����ԫSs�O^�hٙ�1�h�Rh����Ҷ���ڢ�xs]MwVѯ ��t}��{l$+�*1�d�&8��� �0��HԊ�x3��$�.(���E ��P | |
@( ��P | |
@(I����ˣg����j�~U�>�ƀ�;��=r���W�%T��~�Q�eGf��Ms�~����]�jz�~E����P | |
OkE#�V'� <�~�_��U����Met��ykFr�"��W.v��v����!'Gҳa�l�\i� q���vEK��W�$�c�w�S=� | |
/r�t\�-��#��e����槬�T7�QәsB�kAN$�����U��e��a���+��W��I��x>�&ף�5Qs��u|S�@( ��P | |
@( ��P | |
�� ��M�#�_rF{�L����k���e%�In&��,�a�2�}���⸭�_���\��g[��:tx�KW�� �#��4�;h��U��)�C䁪�d���+<�o�_��vt8������,.]O�¥@�fJ���X�^���Y��2'>��O�T{v��%S�~��Ȫ�GL�nN���s��<��⤏:���7n��X�Ho[��S��dr�P | |
@( ��P | |
@( �W~7��� �`z5>�(ѥ�����A�M��q��V��Na.ꬒ�&�grN"�]�h��{ ��j�b�����[u8�Z�X ���P | |
@s���)�om���$�K��u�*r��u�)J�W���m���tY){m�{3Os!�F�' |