SFML 2.4 For Beginners - 5: Keyboard Input.

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ •

  • @enriqueperez339
    @enriqueperez339 7 років тому +33

    these videos are over all amazing i gotta spread the word about this guy

  • @johnpaulcarter7
    @johnpaulcarter7 5 місяців тому +4

    Outstanding videos - beautifully paced, zero bs

  • @ProjectMarzDev
    @ProjectMarzDev Місяць тому

    understand everything so well, this is the best tutorial ive ever seen on sfml everything makes perfect sense thank you so much, i love this tutorial!

  • @softranhh
    @softranhh 4 роки тому +6

    This series is AWESOME!!!! From Vietnam in 2020 :D

  • @AlexChe7
    @AlexChe7 8 років тому +9

    Thank you for your videos! Really easy to understand, nice to see some updated SFML Content!.
    Subbed and waiting for more :D

  • @ChrisVideosGreek
    @ChrisVideosGreek 3 роки тому +3

    l love these tutorials!
    l made the player changing color and size when pressing specific keys!!!

  • @KTATK
    @KTATK 3 роки тому

    this helped me finish my project for school in time, you're awesome!

  • @컴맹컴공
    @컴맹컴공 3 роки тому

    Thank you for your video. I'm glad to know this channel.

  • @LBCreateSpace
    @LBCreateSpace 11 місяців тому

    So easy to follow! Thank you so much

  • @NTC
    @NTC 3 роки тому +1

    you have a very good teaching skill

  • @johnlight-knight8060
    @johnlight-knight8060 5 років тому +1

    Your videos are amazing!! :D

  • @obeasthead
    @obeasthead 2 роки тому

    I have at least 30 keys, can I detect which key is pressed without using switch or if/elseif and pass the key directly to a single function?

  • @industrialdonut7681
    @industrialdonut7681 3 роки тому +1

    excellent much more fun than using a game engine lol

  • @y4ni608
    @y4ni608 2 роки тому

    Thanks great tutorial!

  • @koraykahraman9031
    @koraykahraman9031 2 роки тому

    Thank you. thank you! thank you!!

  • @developerparadise8965
    @developerparadise8965 2 роки тому

    I passed the same floating point values as yours but my player object moves very slow than yours. What's the reason for that?

  • @rennansanches2685
    @rennansanches2685 Рік тому

    i know it has passed such a long time but these videos are helping me so much. Could someone explain me why didnt he put keybord inputs inside the event polling?

  • @efeburako.9670
    @efeburako.9670 Рік тому

    very useful tutorial

  • @kaleemkhattak124
    @kaleemkhattak124 7 років тому

    plz help rectangle only moves when i select the console screen and then reselect the graphic window then i can see changes

  • @NTC
    @NTC 3 роки тому

    I want the cube to slowly move step by step from its current position to the mouse position. How would you do that? I can't seem to get how to delay each step in a for loop - as all the steps happen too fast and it looks like instant jump between the 2 positions.

    • @HilzeVonck
      @HilzeVonck  3 роки тому

      You should look into something called linear interpolation. That will do exactly what you want :)

    • @NTC
      @NTC 3 роки тому

      @@HilzeVonck I want something like time-delay so that we can see as if it is moving, otherwise, it would move so fast

  • @winstonlin6064
    @winstonlin6064 4 роки тому

    Hello Hilze Vonck, the compiler that I used is Clion, and when I try to compile my program with the exact codes that you have, but it gives an error says that: "We got a keyboard without any keys (1)", what is the problem?

    • @matthewreeves6612
      @matthewreeves6612 4 роки тому

      I'm getting the exact same issue (when using MacOS Catalina), did you manage to solve it?

    • @angelmotta
      @angelmotta 4 роки тому

      I also have the same issue, MacOS Catalina and CLion...any solution? I will find something

    • @nunoricardoserafim3187
      @nunoricardoserafim3187 3 роки тому

      I have found a solution, but I don't really like it. If you go to 'System Preferences > Security & Privacy > Input Monitoring' and put your app on the list, it will work. However, you have to do it again every time you make a change to the code.
      If somebody can solve this permanently, please tell

  • @SmileH4nd
    @SmileH4nd 8 місяців тому

    Your character's movement is very clean, how do you do that? When I do it, it seems to have that delay that happens when you write and leave a key pressed, I don't know if you understand what I mean

    • @SmileH4nd
      @SmileH4nd 7 місяців тому

      I already discovered it, I had put all the motion inputs inside pollevents, although I think it shouldn't matter

  • @fuzzzywan
    @fuzzzywan 7 років тому

    Can (objectname).move() work with OpenSceneGraph?

  • @koraykahraman9031
    @koraykahraman9031 2 роки тому

    Please keep the tutorial videos coming

  • @candelaavila3059
    @candelaavila3059 3 роки тому

    thank you so much

  • @sebbsubb9941
    @sebbsubb9941 8 років тому +2

    So my player moves veeery much faster than yours which I guess is because of the different system. Does SFML have some kind of deltaTime that we can multiply the movement with ?

    • @HilzeVonck
      @HilzeVonck  8 років тому

      +Sebb subb Yeah, SFML has a clock class which has a Reset().asSeconds() function. If you call this at the beginning of each frame on a clock you will have the delta time. I think that I cover that in episode 10.

    • @sebbsubb9941
      @sebbsubb9941 8 років тому +1

      You sure did :) Thank you so much for these awesome tutorials I have learned aaalot from them

  • @GunheeYi
    @GunheeYi 6 років тому

    I thought the vectors were pixels in unit, but while 'd' is printed on the console ten times the rectangle seems to be moving more than 10 pixels. Why is that?

    • @redpepper74
      @redpepper74 3 роки тому +1

      the 'd's that are printed out when you press and hold a key are _not_ printed once per frame, while the code that checks whether a key is pressed _is_ run once per frame. (Also, the player is moved at 0.1 pixels/frame.)
      (Also I just realized that you asked this 3 years ago lol)

  • @Parwezh
    @Parwezh 4 роки тому

    My shape moves but it returns to his original state. how to fix that?

    • @HilzeVonck
      @HilzeVonck  4 роки тому

      That probably means that you create the shape in the game loop, not outside

  • @moonglumclampflower8803
    @moonglumclampflower8803 Рік тому

    Your vids are fab. They have really helped me get off the ground, but I got stuck. sf::keyboard is there, but sf::keyboard::key does not exist. I can't find it and the compiler complains when I just type it in and hope. What am I doing wrong? Much appreciated. Moon.

    • @moonglumclampflower8803
      @moonglumclampflower8803 Рік тому

      Just to say that I sorted this. Had a brace in the wrong place so the code would only look at the keyboard when the window was being resized or closed. I moved the close brace up and all working ok. There seem to be some syntax variance between this and newer versions too, but nothing massive.

  • @maddyunderstars3869
    @maddyunderstars3869 8 років тому +1

    Maybe introduce 2 concepts in each video so we don't have to keep waiting for the next episode ;)

    • @HilzeVonck
      @HilzeVonck  8 років тому +1

      +Tytanium I could do that yeah, but that will mean that it will be harder to find an explanation on a specific subject. Right now it wouldn't be a problem, but the further we get, the longer each subject will take per explanation.

    • @HilzeVonck
      @HilzeVonck  8 років тому

      +Tytanium I could do that yeah, but that will mean that it will be harder to find an explanation on a specific subject. Right now it wouldn't be a problem, but the further we get, the longer each subject will take per explanation.

    • @maddyunderstars3869
      @maddyunderstars3869 8 років тому

      Hilze Vonck But, that will mean more useful info, but Idk, I haven't done a scripted video or anything really in a while...
      Anyways, all the tutorials have been really good so far, it's really been helpful :)

    • @HilzeVonck
      @HilzeVonck  8 років тому +3

      +Tytanium It would probably work as fine as what I'm currently doing, but I personally like to keep each subject in a separate video.
      I'm glad that the tutorials have been helpful! :)

    • @maddyunderstars3869
      @maddyunderstars3869 8 років тому

      Hilze Vonck :)

  • @Yusuf-me5pd
    @Yusuf-me5pd 4 роки тому +5

    Now you've read about COVID-19 even here.

  • @leejm4
    @leejm4 5 років тому

    clever

  • @johnlight-knight8060
    @johnlight-knight8060 5 років тому +5

    if I don't use
    window.setFramerateLimit(60);
    then my cpu will run at 100% hahaha

    • @peligros13
      @peligros13 5 років тому +3

      Holy shit thank you so much for this comment
      My program was lagging my computer so hard it could not even play one frame per second, then I used that line and it works very well

    • @johnlight-knight8060
      @johnlight-knight8060 5 років тому +1

      @@peligros13 Glad it helped someone other than myself! 😍

  • @timobeyer9870
    @timobeyer9870 6 років тому +1

    Why no Sprites?

    • @jaideepshekhar4621
      @jaideepshekhar4621 6 років тому +3

      Because they introduce a level of complexity not needed at this stage. Also, we do not need any special textures, a solid background is good enough.

  • @colorado34070
    @colorado34070 4 роки тому

    +1