diff --git a/alert.html b/alert.html new file mode 100644 index 0000000..4373ec0 --- /dev/null +++ b/alert.html @@ -0,0 +1,16 @@ + + + + + + + Vytvaření Alertu + + + + + + + + + \ No newline at end of file diff --git a/eval.html b/eval.html new file mode 100644 index 0000000..e69de29 diff --git a/hodkostkou.html b/hodkostkou.html new file mode 100644 index 0000000..1519041 --- /dev/null +++ b/hodkostkou.html @@ -0,0 +1,19 @@ + + + + + + + Document + + + + +

Hod Kostkou

+ + +
+ + + + \ No newline at end of file diff --git a/hra.html b/hra.html new file mode 100644 index 0000000..b2b11ac --- /dev/null +++ b/hra.html @@ -0,0 +1,28 @@ + + + + + + + Mini Hra + + + +

Mini hra

+ + + + +
Historie boje:
+ + + \ No newline at end of file diff --git a/hra.js b/hra.js new file mode 100644 index 0000000..10ecdb9 --- /dev/null +++ b/hra.js @@ -0,0 +1,89 @@ +//nastavení proměných +var enemyName = ['Duch', 'Vlk', 'Učitel', "Lebka", "Kostlivec"]; +var enemyHp = hodkostkou(50); +var enemyDamage = hodkostkou(10); + +var heroHp = 40; +var heroDamage = 6; +let heroDefend = false; + + +function init() { + nameChoise = Math.floor(Math.random() * enemyName.length) + document.getElementById("enemyName").innerText = enemyName[nameChoise]; + document.getElementById("enemyHp").innerText = enemyHp; + document.getElementById("enemyDamage").innerText = enemyDamage; + document.getElementById("heroHp").innerText = heroHp; +} + +//FUNKCE +function heal() { + heroHp = parseInt(heroHp) + parseInt(hodkostkou(10)); + battlelog("Výlečil ses
"); + document.getElementById("heroHp").innerText = heroHp; + + enemyAttack(); + gameover(); +} + +function attack() { + enemyHp = parseInt(enemyHp) - parseInt(heroDamage); + battlelog("Zautočil jsi
"); + document.getElementById("enemyHp").innerText = enemyHp; + + enemyAttack(); + gameover(); +} + +function defend() { + heroDefend = true; + battlelog("Použil jsi obranu
"); + gameover(); +} + +function luck() { + let luck = hodkostkou(10) + if (luck < 5){ + heroHp = 0; + } else { + enemyHp = 0; + } + gameover() +} + +function enemyAttack() { + if (!heroDefend) { + battlelog("nepřítel zaútočil
"); + heroHp = parseInt(heroHp) - parseInt(enemyDamage); + document.getElementById("heroHp").innerText = heroHp; + heroDefend = false; + } else { + battlelog("vykryl jsi protiútok
"); + heroDefend = false; + } + + gameover() +} + +//Globalní funkce +function hodkostkou(stena) { + //alert(stena); + let x = 1 + Math.floor(Math.random() * stena); + console.log("x:"+x); + return x; +} + +function gameover() { + console.log("zjistuji stav -Enemy"+enemyHp + ",hero"+heroHp); + console.log() + if(enemyHp <= 0){ + document.getElementById("game").innerHTML = "

Vyhrál jsi

" + } else if (heroHp <= 0) { + document.getElementById("game").innerHTML = "

Prohrál jsi

" + + } +} + +function battlelog(text2log) { + document.getElementById("battlelog").innerHTML += text2log; +} \ No newline at end of file diff --git a/mapa.html b/mapa.html new file mode 100644 index 0000000..2003222 --- /dev/null +++ b/mapa.html @@ -0,0 +1,40 @@ + + + + + + + Document + + + + +
+ + +
+ + + \ No newline at end of file diff --git a/pc.html b/pc.html new file mode 100644 index 0000000..9463a6a --- /dev/null +++ b/pc.html @@ -0,0 +1,21 @@ + + + + + + + Pocitadlo v2 + + + + + + +
+
5
+ + + + + + \ No newline at end of file diff --git a/pocitadlo.html b/pocitadlo.html new file mode 100644 index 0000000..f2d0b21 --- /dev/null +++ b/pocitadlo.html @@ -0,0 +1,36 @@ + + + + + + + Pocitadlo + + + +
+ +
+ + +
0
+ + + + \ No newline at end of file diff --git a/pocitadlo.js b/pocitadlo.js new file mode 100644 index 0000000..c40db08 --- /dev/null +++ b/pocitadlo.js @@ -0,0 +1,30 @@ +function vynulovat() { + document.getElementById("cislo").innerText = 0; +} + +function pridat() { + let x = document.getElementById("cislo").innerText; + x = parseInt(x)+1; + document.getElementById("cislo").innerText = x; +} + +function odebrat() { + var x = document.getElementById("cislo").innerText; + x = parseInt(x)-1; + document.getElementById("cislo").innerHTML = x; +} + +function createAlert(textAlertu) { + alert(textAlertu) +} + +function hodkostkou(stena) { + //alert(stena); + let x = 1 + Math.floor(Math.random() * stena); + console.log(x); + + var y = document.getElementById("vysledek"); + if (y != null){ + document.getElementById("vysledek").innerText = "Při hodu " + stena + " stěnnou kostkou si hodil " + x; + } +} \ No newline at end of file diff --git a/pribeh.html b/pribeh.html new file mode 100644 index 0000000..5997cde --- /dev/null +++ b/pribeh.html @@ -0,0 +1,76 @@ + + + + + + + Jednoduchy Pribeh + + +

Příběh

+ +
+
+ + + + + + + \ No newline at end of file diff --git a/promenne.html b/promenne.html new file mode 100644 index 0000000..7a6a9c6 --- /dev/null +++ b/promenne.html @@ -0,0 +1,23 @@ + + + + + + + Document + + +
+ + + + \ No newline at end of file diff --git a/seznamy.html b/seznamy.html new file mode 100644 index 0000000..5e15ab7 --- /dev/null +++ b/seznamy.html @@ -0,0 +1,57 @@ + + + + + + + Změna všeho + + + +

Změna textu

+

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Voluptas, eligendi itaque. Quasi, ut? Iure quasi laborum minima quam magni nulla autem architecto, esse nisi error corrupti adipisci velit facilis. Hic.

+ +
+ + + + + + + + \ No newline at end of file diff --git a/seznamy_V2.html b/seznamy_V2.html new file mode 100644 index 0000000..04108b4 --- /dev/null +++ b/seznamy_V2.html @@ -0,0 +1,62 @@ + + + + + + + Změna všeho + + + +

Změna textu

+

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Voluptas, eligendi itaque. Quasi, ut? Iure quasi laborum minima quam magni nulla autem architecto, esse nisi error corrupti adipisci velit facilis. Hic.

+ +
+ + + + + + + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..a5f033f --- /dev/null +++ b/style.css @@ -0,0 +1,4 @@ +@import url('https://fonts.googleapis.com/css2?family=Comforter&family=Roboto:wght@300&family=Rubik+Beastly&display=swap'); +#cislo { + font-size: 100px; +} diff --git a/uvod.html b/uvod.html new file mode 100644 index 0000000..cabefaf --- /dev/null +++ b/uvod.html @@ -0,0 +1,35 @@ + + + + + + + Document + + + +

Welcome

+

Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat vitae quasi fugit vero saepe sit hic laudantium repellat. Quaerat provident odio aut aspernatur quidem ipsum ducimus, similique ipsam quam est?

+
+
TENTO TEXT SE BUDE MENIT
+ + + + + + + + diff --git a/zmenapisma.html b/zmenapisma.html new file mode 100644 index 0000000..1c77012 --- /dev/null +++ b/zmenapisma.html @@ -0,0 +1,55 @@ + + + + + + + Změna písmen + + + +

Testovač písmen

+
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Sapiente veniam commodi, eius natus adipisci illo ipsa maiores explicabo debitis magnam itaque perspiciatis quae, voluptatum quasi hic delectus dolorem ad optio.

+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure fugit nulla ea assumenda voluptates, eaque id laudantium qui voluptatem ducimus perferendis adipisci fugiat aliquam, rem asperiores commodi ratione culpa quo.

+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure fugit nulla ea assumenda voluptates, eaque id laudantium qui voluptatem ducimus perferendis adipisci fugiat aliquam, rem asperiores commodi ratione culpa quo.

+
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/zvetsovadlo.html b/zvetsovadlo.html new file mode 100644 index 0000000..bb903ae --- /dev/null +++ b/zvetsovadlo.html @@ -0,0 +1,42 @@ + + + + + + + Pocitadlo + + + +
+ +
+ + +

50
px

+ +

Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum, veniam est aliquid quia fugit officiis error ratione? Repellat quam magnam maxime, quo dolorem, ab neque illum tempora natus sed blanditiis!

+ + + + \ No newline at end of file