Facebook
From adisb2115, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 204
  1. class Gracz{
  2.  constructor(nazwa){
  3.   this.imie = nazwa;
  4.   this.liczbaPodejsc = 10;
  5.   this.czas;
  6.   this.propozycja;
  7.   this.oknoKomunikatu;
  8.   this.komunikat;
  9.        
  10.   this.informacja = function(tekst){
  11.         this.oknoKomunikatu = document.getElementById("informacja");
  12.         this.komunikat = document.createTextNode(tekst);
  13.         this.oknoKomunikatu.replaceChild(this.komunikat,this.oknoKomunikatu.childNodes[0]);
  14.         //alert(this.oknoKomunikatu.innerHTML);
  15.   }
  16.  
  17.   this.gramy = function(){
  18.         this.start = Date.now();
  19.        
  20.         while(true){
  21.                
  22.         }
  23.   }
  24.  }
  25. }
  26.  
  27. var gracz1 = new Gracz(prompt("Podaj imię!"));
  28. gracz1.informacja("siema "+gracz1.imie);