Build A Speed Typing Game With JavaScript - Tutorial

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии •

  • @1flybyguy
    @1flybyguy 5 лет назад +15

    Your homework to improve on this great tutorial is to: 1) don't start the timer until you start typing, 2) after successfully typing the quote, add the results to a list at the bottom showing the quote, elapsed time, and calculate the wpm. Awesomeness!!!!

    • @nicklandreth2527
      @nicklandreth2527 5 лет назад +5

      How about preventing further text entry on an incorrect character entry?

    • @elooouan
      @elooouan Год назад

      @@nicklandreth2527 very easy, just change *let correct = true* to *const* and you're done

  • @charliegroves
    @charliegroves 4 года назад +6

    Wow this was amazing. Not only did it help me build a cool game, it taught me the basic concepts of JS which I can apply to other projects and use to expand this project! I don't know anyone else on RUclips who is this chilled, smart, and can dumb down concepts to new programmers to get them excited and teach them at the same time! Thank you.

  • @Stormface16
    @Stormface16 5 лет назад +8

    The game tutorials are insanely fun to watch. Keep up the great work!

  • @internetuser4689
    @internetuser4689 5 лет назад +57

    WDS: makes speed typing game...
    Me: This is h1

    • @oscwavcommentaccount
      @oscwavcommentaccount 5 лет назад +7

      Me:
      body {
      background-color: black;
      color: white;
      }
      Dark mode

  • @prajjwalrajput908
    @prajjwalrajput908 5 лет назад +12

    I've no words to describe how much I'm learning from your videos, thank you very much 😊

  • @sergten
    @sergten 4 года назад +2

    I've been procrastinating on making something like that because I didn't know how. Thanks for the fantastic tutorial.

  • @TGK_Minecraft
    @TGK_Minecraft 5 лет назад +3

    I love your videos and they inspired me to create my own, they may not be as good as yours but I am getting there! Keep it up!

  • @_the_one_1
    @_the_one_1 5 лет назад +2

    Amazing, I discovered your channel a short time ago, I subscribed, checked the bell and I enjoy watching every new video. I really love the way you code and the way you think about the solution. Thank you for such an amazing and rich content on your videos.

  • @aliaksandrtarashkevich3048
    @aliaksandrtarashkevich3048 5 лет назад

    Maaaan, that's the best tutorial i've seen on YT so far, thank you!

  • @mychautight9727
    @mychautight9727 3 года назад

    This is really easy to follow, especially for people that aren't good at computer science.

  • @GaLaVrAmOv
    @GaLaVrAmOv 4 года назад +2

    Great Tutorial, I liked the way you made it,
    but actually there's one thing, and that is you just gonna make another setInterval, so after like 30 sentences your game will start to get stucked until you'll refresh the page, so you want to make sure that you don't gonna run setInterval twice.
    I think you can say if startTime == undefined then run setInterval, so you gonna run this only one time.

  • @mykalimba
    @mykalimba 5 лет назад +6

    You may find that increasing the frequency of the timer (down to maybe every 1/10 or 1/20 second) yields a more consistent visual update. Because the setInterval timing is not 100% reliable, imagine that it triggers 1 millisecond before some whole time value (e.g. the interval occurs at 9.999 seconds). The user watching the screen will expect a 10 to display, but it will still be showing a 9, and will only change to a 10 at the _next_ interval, which is about another second away.

    • @7heMech
      @7heMech 2 года назад

      how would you fix that

    • @mykalimba
      @mykalimba 2 года назад

      @@7heMech Check the code at 23:46. What function is being used to start the interval timer, and what value controls how frequent that interval is?

  • @m9ss749
    @m9ss749 3 года назад

    I know nothing about coding and I could actually follow along

  • @juanmondragon4543
    @juanmondragon4543 5 лет назад

    thank you so much for this ! this is a great example of how to use for loops and gives you a good understanding of how one would use it in a real world scenario instead of those boring for loop tutorials !

  • @jean-francoisbouzereau6258
    @jean-francoisbouzereau6258 5 лет назад +1

    Funny little game! One remark : the timer is never stopped, so a new timer is uselessly added at each new sentence. Also one nice trick you can use is the fact that x|0 converts x into an integer, avoiding Math.floor .

  • @chillsjiujitsu
    @chillsjiujitsu Год назад

    @13:49 kept getting "Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerText')
    at renderNewQuote (script.js:12:35)"
    that prevented the random quotes displaying in JS, wondering what exactly I did wrong cause the most I could find online was that my js should be put after the header

  • @terbium1525
    @terbium1525 5 лет назад

    After starting watching your videos.. I've learned a lot from you. Thanks for inspiring others!

  • @shelbyrothman4522
    @shelbyrothman4522 3 года назад

    This was another great one Kyle thank you! :)

  • @kaceymyers-churchill9451
    @kaceymyers-churchill9451 4 года назад

    great videos! you're really helping me learn along side my bootcamp

  • @vineetmaurya369
    @vineetmaurya369 3 месяца назад

    Great tutorial, thanks a lot

  • @Asty__
    @Asty__ 4 года назад +1

    Great video! What I'm not sure to understand is that you say that we can't believe setInterval because it might not be accurate, but even though you're getting the right time delta that will be displayed, you are in fact updating to the correct/accurate value every inaccurate second. Am I right? In other words, let's say setInterval updates every 1.1 second, then it means you'll update the timer text to the accurate time value between two dates, but you update it every 1.1 second regardless, because the function to update it is called with that time interval, so how does it make it more accurate in the end?
    Thank you for all of your videos and tutorials. They've been very helpful, and you are great at explaining and detailing everything.

  • @santespro
    @santespro 5 лет назад

    Very helpful stuff. Keep making vids on JavaScript

  • @wiffec
    @wiffec 5 лет назад

    Very nice man. Keep doing this!

  • @michaeldalip
    @michaeldalip 5 лет назад

    Excellent video. Great pace

  • @bhaskartmb
    @bhaskartmb 5 лет назад +1

    Dude you're really awesome 👏

  • @mohammadnaim9226
    @mohammadnaim9226 2 года назад

    Nice explanation and amazing project brother

  • @easytech2105
    @easytech2105 3 года назад

    great work man. keep it up.

  • @4artificial-love
    @4artificial-love 5 лет назад +1

    With that face and voice, you could be in Hollywood! Danm!

  • @davidcalabrese6053
    @davidcalabrese6053 3 года назад

    Fantastic lesson, thank you for putting this together!

  • @techgix
    @techgix 2 года назад

    nice lesson really learnt a lot

  • @MsTaralala
    @MsTaralala 4 года назад

    super well made video that explains a good beginner project! easily able to advance it with a level keeper, WPM, # of mistakes displayed

  • @WizarD7995
    @WizarD7995 5 лет назад

    Good job mate. Unique idea for app.

  • @ErrorDebug
    @ErrorDebug 5 лет назад +2

    Hey thanks for everything. I wanna ask you if you can make a video about API's, not about how they work like you alredy did but how to actually find free API's, and use them inside code, I am still confused about this because on the web there is a lot of API's and i dont know how to find it and implement it etc, like, where does ip key go inside of the code, what if we get an error 403 or smth like that how to fix it and get access to data. I hope you understand, thanks and take care!

  • @lewasaur
    @lewasaur 4 года назад

    How do you make the timer stop without reloading the page?
    great tutorial btw!

  • @Buffnerd_i
    @Buffnerd_i 4 года назад

    I simply love your channel, thank you so much!

  • @ZakirHossain-pz4pd
    @ZakirHossain-pz4pd 5 лет назад +3

    Hi Kyle. This mini-project seems pretty fun. I myself wanted to learn fast typing, so I think I could take advantage of it. I will improve the game into more interactive and realistic. Thank you for helping to start up. At this time I could not progress forward because the API you are using is not working from my machine. It says that it can't be found. Do you think the API is down now?

  • @VishalKumar-fw5fz
    @VishalKumar-fw5fz 5 лет назад

    thanks
    wanna more videos like this

  • @shazbaz5695
    @shazbaz5695 5 лет назад +4

    Can you please do a full crash course on Javascript with examples of things you are most likely to do at workplace?

    • @aammssaamm
      @aammssaamm 5 лет назад +1

      This piece is the exact example of what you would do at workplace: text editor plus a version control tool, a very important tool which should work correctly with all kind of characters. Challenge: add html formatting to text and compare 2 versions with formatting using the same highlighting.

  • @unmy400
    @unmy400 5 лет назад +4

    is there a case where you won't use the Box-sizing: border Box by default ?

    • @pulga961
      @pulga961 5 лет назад +1

      bootstrap also implemented border box for every element eith pseudo before and after

  • @BananaCoding
    @BananaCoding 5 лет назад

    Cool idea, keep your work on!

  • @giorgimerabishvili8194
    @giorgimerabishvili8194 5 лет назад

    Great channel! Thank you very much!

  • @Keegan-T
    @Keegan-T 3 года назад

    extremely helpful thank you

  • @LinkChenTW
    @LinkChenTW 5 лет назад

    Nice! I didn't know that setInterval won't give you a exact second

  • @davimendes4404
    @davimendes4404 3 года назад +1

    Awesome! Any ideas on how could i make it print out a text of my choice instead of a random quote??

    • @foncode101
      @foncode101 Год назад

      create a var array of strings instead of api or create a file, json with the text of your choice and point api to your file

  • @Shaggy_3005M
    @Shaggy_3005M 5 лет назад

    you make it look so easy:=0

  • @boris7258
    @boris7258 3 года назад

    "Thank you very much and have a good day" ©

  • @arunkaiser
    @arunkaiser 5 лет назад

    Fantastic 🤘😝🤘👍😻👍

  • @vinodreddy5646
    @vinodreddy5646 5 лет назад +1

    Thank you 🙏🙏

  • @vinayprince6267
    @vinayprince6267 5 лет назад +1

    Your videos are awesome bro & the way you explain is superbbbb please do video on jQuery Ajax & JavaScript all combination once please 😍😍😍

    • @pulga961
      @pulga961 5 лет назад

      i think jquery is outdated...people are moving to virtual DOM like React and Vue

    • @aammssaamm
      @aammssaamm 5 лет назад

      Not so fast :) Which is really outdated it’s your react and vue :) jQuery remains a very effective and quick tool. Virtual DOM is a total crap :)

  • @siilverpiink
    @siilverpiink 3 года назад

    THANK YOU SO MUCH

  • @shikhrajsingh5726
    @shikhrajsingh5726 4 года назад

    Thanks a ton!!! Really fun project. Leant loads from it.
    Can you please tell me how to add the typing speed in WPM?

  • @daniseflores
    @daniseflores 4 года назад

    would it make a difference if I put the tag at the bottom of the body so I don't have to use defer?

  • @pulga961
    @pulga961 5 лет назад

    we are still relay on seInterval to render timer...Does it mean that real time counter is not accurate but if we stored for example win time in a table somewhere it will be more accurate than in real time?

  • @syedalimehdi-english
    @syedalimehdi-english 3 года назад

    I started learning web dev 2 months ago.
    Without any effort, i see difference i made in 2 months.
    And i'm watching these videos at night before sleeping lmao 🤣

    • @nephalem7812
      @nephalem7812 Год назад

      What now? Did u work somewhere or just programming as a hobby? Answer please

    • @syedalimehdi-english
      @syedalimehdi-english Год назад

      @@nephalem7812 i'm working as a software engineer now, its been 4 months into this job, got 4 offers though.

    • @vedikamishra009
      @vedikamishra009 23 дня назад

      @@syedalimehdi-english wow, congrats!

  • @el_teodoro
    @el_teodoro 2 года назад

    Can you redo this with a recommended library (like ReactJS)!

  • @fvdham
    @fvdham 5 лет назад +2

    I expected arrayValue[index] to give an out of bounds exception instead of null.

  • @sllujaan
    @sllujaan 4 года назад +1

    Also make an app that highlights searched text with regex and javascript

  • @forgiveness_denied
    @forgiveness_denied 4 года назад

    is there's a new standard in JS not to use semicolons in the end ?

  • @rohitkudalkar92
    @rohitkudalkar92 5 лет назад

    whenever I see @UCFbNIlppjAuEX4znoulh0Cw notification in my phone. I feel happy and enthusiastic because I get to know that I going to learn something new and it will be so easy as well. efforts that you take for us is really helpful. Love and support sir.

  • @dimitridoroshko
    @dimitridoroshko 5 лет назад +14

    Please use semicolons, it hurts when I look at the code missing them...

  • @deepakbhargav7434
    @deepakbhargav7434 4 года назад

    Thank you sir

  • @hrithiktg4054
    @hrithiktg4054 5 лет назад +1

    thank you!

  • @robiparvez
    @robiparvez 5 лет назад

    why am i watching this at 3.42 am without sleeping?

  • @UmidAlmatov
    @UmidAlmatov 5 лет назад +1

    Funny project.
    How timer.innerText = setTimerTime(); works? I thought it should be timerElement, but it works with timer variable too. How??? ))
    And yes, as mentioned in comments, interval should be cleared.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +3

      This should be timerElement, but I accidentally put timer. The reason this works is because in JS all the elements with ids have a variable automatically created for that element that has the same name as the id.

  • @soyaiburrahman3806
    @soyaiburrahman3806 2 года назад

    where did you find timer.innerHTML ?

  • @silkroadtech1804
    @silkroadtech1804 3 года назад

    Thanks bro...

  • @budket2513
    @budket2513 5 лет назад +4

    Your last project ideas are already made by other youtubers few years ago. I'd like to see different projects.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +15

      Do you have any project idea suggestions. I am open to anything. I also feel that even if something has been done before that I have my own twist I put on the project to make the learning experience enjoyable.

    • @soltiscd
      @soltiscd 5 лет назад +3

      @@WebDevSimplified the api no longer works...

    • @bikramchetttri6483
      @bikramchetttri6483 5 лет назад

      @@WebDevSimplified Hey Kyle can you make a tutorial on product image zoomer like ecommerce website flipkart or snapdeal.

    • @roydonk2878
      @roydonk2878 5 лет назад

      @@soltiscd Yes it does, try again or go to the API github page to see what you're doing wrong.

    • @stillwinner8631
      @stillwinner8631 5 лет назад

      @@roydonk2878 Can you explain me? Because I see didn`t working API (

  • @leo848
    @leo848 5 лет назад +3

    Why isn't this api working?

    • @1flybyguy
      @1flybyguy 5 лет назад

      It works... check your typing. I was pulling my hair out until I found I didn't include the return in the fetch function.

  • @StarGames1542
    @StarGames1542 2 года назад

    nice work except i tried running the link there wasnt an option can you help?

  • @johnscale102
    @johnscale102 4 года назад

    why i'm pressed a whole quote but it doesn't change to the next quote? sorry for my bad english

  • @kubo407
    @kubo407 5 лет назад

    This is a really great tutorial, only problem is that api.quotable.io/random is no longer available. This breaks the whole thing and I do not know how to replace the const with a string or source from a txt file or something and fix the fetch code to work with the change.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      The API is working when I check it. It may have been down temporarily.

    • @giuse7
      @giuse7 5 лет назад

      For me the API has also been down for the last 3 days.

  • @boco6969
    @boco6969 2 года назад

    @15:56 is how I react to my code every time I compile

  • @resumosnews
    @resumosnews 4 месяца назад

    Meu deus cade o ";" estou incrédulo ate o momento. 19:26

  • @kevinmungame1869
    @kevinmungame1869 3 года назад

    Thank you

  • @jonhardlarsen8562
    @jonhardlarsen8562 5 лет назад

    Hi Kyle, first of all thank you for all your good stuff. I was wondering why I can't load the site "api.quotable.io/random". api.quotable.io’s server IP address could not be found.

    • @Asty__
      @Asty__ 4 года назад

      Make sure you spell the URL correctly. It should be working when it is spelled correctly

    • @shikhrajsingh5726
      @shikhrajsingh5726 4 года назад +1

      @@Asty__ I don't think that the API exists anymore

  • @Ath9394
    @Ath9394 5 лет назад

    Kyle bro, We need you on udemy

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      I am not a big fan of how Udemy is structured for instructors so I have my own course platform at courses.webdevsimplified.com

  • @DeepakGupta-hj2dv
    @DeepakGupta-hj2dv 5 лет назад

    Please make on series redux tutorial

  • @jayasreejana4568
    @jayasreejana4568 4 года назад

    How can I set my own random words?

  • @Warpgatez
    @Warpgatez 5 лет назад

    Hey kyle, kyle here. Wouldn't you just put the script tag at the bottom of the body rather than defering it in the head?

    • @pulga961
      @pulga961 5 лет назад +1

      he probabbly dont wanna mix scipts with other elements....What if he had multiple scripts and some of them wants to defer some of them not, so he than need to jump from top to bottom of the file.

  • @meaningmean
    @meaningmean 5 лет назад

    wow learned alot

  • @mastergamer4335
    @mastergamer4335 3 года назад

    i optimized the timer if you are iterested

  • @张江胜
    @张江胜 5 лет назад

    "timer.innerText = getTimerTime()",
    why not is
    "timerElement.innterText = getTimerTime()"?

  • @giuse7
    @giuse7 5 лет назад +1

    Sadly, the Api is down.

  • @RaGaTheLegend
    @RaGaTheLegend 5 лет назад

    Hii.....i want to ask wuestion

  • @christiansuzuki2129
    @christiansuzuki2129 4 года назад +2

    My classmate submitted this project as his final. He got expelled lmaoo

    • @ziaahmad8738
      @ziaahmad8738 3 года назад

      for plagiarism?

    • @hulk6315
      @hulk6315 3 года назад +1

      @@ziaahmad8738 for simplicity

  • @sashatv138
    @sashatv138 5 лет назад

    Cool!

  • @kaidoesthingsxyz
    @kaidoesthingsxyz 2 года назад

    currently building this in svelte like most of these tutorials...

    • @kaidoesthingsxyz
      @kaidoesthingsxyz 2 года назад

      i made a virtual keyboard that links to normal keyboard events, any events from the regular keyboard will have "isTrusted" set to true

  • @utkarshmittal9245
    @utkarshmittal9245 3 года назад +1

    Hello 👋

  • @rajansood964
    @rajansood964 5 лет назад

    Great

  • @moussagerges6709
    @moussagerges6709 4 года назад +1

    Thank you very much😊, you can find source code here: github.com/MoussaGerges9/Typing-Speed-Test.git

  • @mohammadnaim9226
    @mohammadnaim9226 2 года назад

    The api you provided is not working bro

  • @pulga961
    @pulga961 5 лет назад

    nice

  • @sardarchouhan6048
    @sardarchouhan6048 4 года назад

    offline me nhi typing nhi ho rhi hai

    • @sardarchouhan6048
      @sardarchouhan6048 4 года назад

      : makes speed typing game... yes sir typing game offline me

  • @meoteormonter4582
    @meoteormonter4582 3 года назад +1

    Api is down right now.

  • @pheaktrakim1212
    @pheaktrakim1212 4 года назад

    Hello sir, How can I create random words by myself sir ?

  • @FratNightGaming
    @FratNightGaming 2 года назад +5

    you really didnt explain anything. you just stated the code you wrote. not terribly helpful as an instructional video unfortunately

  • @just_code
    @just_code 5 лет назад

    You talk so fast dude, rapgod

  • @haseenafridi1953
    @haseenafridi1953 3 года назад

    it doesn't work

  • @declan9108
    @declan9108 5 лет назад

    First

  • @aniket1008
    @aniket1008 9 месяцев назад +1

    if anyone wants to generate random texts or words or special characters with additional functionalities checkout npm i typingspeedtext