SFML 2.4 For Beginners - 13: Jumping.

Поділитися
Вставка
  • Опубліковано 31 жов 2024

КОМЕНТАРІ • 95

  • @esoteryk
    @esoteryk 3 роки тому +22

    Hope to see more tutorials in the future. You have truly helped me out thank you !

  • @ron0studios
    @ron0studios 4 роки тому +12

    I remember when this vid just came out, its been 3 years! please continue this!!!

  • @szinton
    @szinton 6 років тому +10

    I watched this video one day when I was making my first 2D game in C++. Now I'm making a 3D game engine and couldn't get collision to work. Reminded myself of this video and it helped, eventhough it's shows 2D collision =)
    Thanks a lot man!

  • @frittatas__
    @frittatas__ 7 років тому +35

    Damn dude, your tutorials are really great! I hope you continue them, you've helped me a lot!

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

    Thank you, I am just getting started on an SFML game, but I'm using the C bindings, making following along with most tutorials tough, because they're all in C++. However, it was much easier to adapt your lessons than anyone else's c++ lessons because yours are so clear and concise. Great stuff! I hope you make more eventually!

  • @rasulov486
    @rasulov486 Рік тому +1

    Just wanted to thank you a lot for these videos. They are simple but yet so powerful. Thank you very much!

  • @quicksilver90-g8h
    @quicksilver90-g8h 3 роки тому +2

    This guy really helped me create a 2D game but now I don't even know if this guy is alive or not. He hasn't uploaded in 4 years. Sad.

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

    Keep it up, you're the only guy I can learn SFML from.
    And with this new setup, it'll be even better.

  • @TheLordOfMinecraft1
    @TheLordOfMinecraft1 7 років тому +47

    Please come back to UA-cam!!!

  • @orocimarosay1447
    @orocimarosay1447 7 років тому +9

    please more tutorials because you know many many things and we can all learn from you

  • @jakubdzwigacz4563
    @jakubdzwigacz4563 2 роки тому +2

    great tutorial for the basics of sfml, everything was explained very clearly i really like it

  • @learningicdl8669
    @learningicdl8669 4 роки тому +3

    Thank you so much for your beautiful tutorial. Please continue!

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

    man i wanted to enter in gui, but i didnt really know anything apart from opengl and opengl has a huge learning curve, awsome tutorials, you earned a sub

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

    Almost 4 years later, still helping people to get through IT subjects at University :DD

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

    These tutorials have been tremendously helpful! I watched every one, some multiple times. You have improved my c++ and SFML greatly and I really hope you're doing well and one day, if you're not too busy, will once again make a tutorial :) thank you!

  • @PacVan123
    @PacVan123 10 днів тому

    Excited for your Graphics Programming talk at BUas :)

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

    Great tutorial! To these people who might have error E0461 - just set && in the Collider class - Check Collision, should work. (Collission &&other).

  • @warshon123
    @warshon123 7 років тому +3

    I think the reason for falling through the floor when moving the window is because it pauses deltaTime. When the window is released, deltaTime will be however long it was held. In the statement that applies gravity, velocity.y += 981.0f * deltaTime, if deltaTime is large enough, say 1 second, out velocity.y is equal to 981.0f. On the next frame, we move exactly that much, completely skipping through the floor before we can detect collision. It has nothing to do with how close you are to the edge. I think I solved this (At least partially) by adding a isTouchingGround boolean to player. It is initialized to false and becomes false whenever jumping. It becomes true when jumping or whenever y velocity is not 0.0f. It becomes true when colliding with the ground. Gravity is only applied if !isTouchingGround. To ensure that you can't walk off the edge and float due to isTouchingGround being set to false, you have to set velocity.y to true if isTouching ground is true. This is fine most of the time because you collide with the ground constantly, but when you walk off the edge, you'll still fall. The only issue that I couldn't fix is that if you Move with screen while in midair, the problem persist because you can build up deltaTime, so it needs some work. Your way is better right now, I just wanted to give perhaps a lead to a solution. Thank you for your tutorials!

  • @mr.beagle4217
    @mr.beagle4217 3 роки тому

    Thanks for your SFML tutorials you've really helped me out a bunch. Cheers!

  • @warus4245
    @warus4245 6 років тому +2

    Actually you don't have to set deltaTime to anything to avoid Tux's falling down. You can also create sf::Vector2i window_position=window.getPosition(); and make a while loop:
    while(window_position!=window.getPosition())
    {
    clock.restart();
    window_position=window.getPosition();
    }
    And that's it, Tux'x not falling anymore and i think it's better than setting deltaTime to specific value :)

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

    Very nice series. Too bad that the last videos were 4 years ago. Hoping for a comeback :)

  • @mikoajkorbanek9299
    @mikoajkorbanek9299 7 років тому +15

    Will you continue the guide?

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

    best tutorials on youtube
    please continue the series

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

    Keep making these!! They are SO helpful!!!!

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

    His explanations are so damn understandable

  • @valizeth4073
    @valizeth4073 4 роки тому +3

    When you've been coding in c++ for almost 5 years, every single day, when it's your life.
    And you sit for hours on end to fix a bug that turned out to be because of a horrible copy-paste accident.

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

    THANK YOU SOOO MUCH!!!! This was very very helpful!

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

    See you in the next one, im waiting

  • @Osama-kx3cq
    @Osama-kx3cq 2 роки тому +2

    Please do some follow ups. Love your videos

  • @N3therPig
    @N3therPig 7 років тому +2

    I just came here for the Canadian "sorry"

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

    Are you planning on recording any more tutorials? These have been really useful.

  • @PaprikaYT
    @PaprikaYT 4 роки тому +1

    Where are you man :( we need you

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

    Thanks! Keep going! Good luck!

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

    Hi! nice video, clear and easy to understand :) just wondering will you be tackling about SAT collision detection?

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

      I might do a tutorial about SAT in the future. But it probably won't be any time soon. I don't think that most of my subscribers are on the level that they need to be at in order to understand SAT. I do however have a video that I made for uni in which I explain the basic concept of SAT, and there are a lot of great textual tutorials available on the internet if you are really interested in this topic.

  • @khyle402
    @khyle402 5 років тому +1

    Yo Dude your tutorials are really good. Are you going to continue them ?

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

    hey dude, great job
    !!!
    could you post the sourse code, please

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

    Thanks you

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

    Thanks!

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

    Man, where did you go? I'm worried :(

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

      me too man... does anybody know something about this guy?

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

      Hey! Sorry I fell off of the face of the earth. College all of a sudden became a lot more busy since I had to build up a portfolio, then I had two internships and now I'm working full time at Nixxes Software. Life has been busy. :)
      I really would like to come back to UA-cam however since I loved making this video's, so I might make a couple more video's in the next couple of months!

    • @ephraim009
      @ephraim009 3 роки тому +2

      @@HilzeVonck oh hey! I’m glad you’re doing fine! God bless you man in whatever you’re doing!

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

      Thank you so much!
      I have honestly been having a great time working at Nixxes for the last two to three years.
      In that time I have worked on four released games. Tomb Raider, Lara Croft and the Guardian of Light and Lara Croft and the Temple of Osiris on Stadia, and Marvel's Avengers on Xbox Series X/S.
      This would've never been possible at any other company, so I am really grateful of where I am in life.

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

      @@HilzeVonck damn, that’s amazing! I’m actually happy for you man! Wishing u the best

  • @nico.7907
    @nico.7907 3 роки тому

    Please come back to youtube!!!!!

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

    Please don't stop making the tutorials.

  • @idol2010
    @idol2010 5 років тому +1

    Please Back to UA-cam!!

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

    Hey great video as always!, i noticed a bug and i'm not sure if it is only working on my machine but whenever you place your character to close to the edge, like standing on the edge by only 1 pixel and resize the window, the character will fall off the edge into oblivion

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

      Thank you Jayggz! Haha, yeah I know that that bug exists. It is a less evil version of the bug that I tried to fix at the end of the video. There are ways to solve this problem, but they mostly involve more complicated collision systems. So for now just make it so your player cannot resize the window while he/she is one pixel away from the edge.

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

    Nice video

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

    can you make a tutorial about text cout on the sfml window, with font and all the rest of the pretty text thingies?

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

    Hi, a quick question again... How can we use 'void' functions on sfml. I tried but it doesn't know the window we have rendered. and if we render again it creates a new window

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

    Hello! Awesome tutorial! I got this little bug where if I'm not jumping the white platforms tremble a little like they move up and down just by a bit constantly except while the penguin is in jump state and is flying - then they become static. Its annoying they are like moving up and down just by a little unless you are jumping then they are fine... If you have any idea how to fix this it would be great ! :)

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

      That happen because the player continuously collides with the ground due to velocity_y increasing due to gravity. An easy fix is to create a variable gravity that is zero when you can jump and 981.0f when you can't.

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

    Hi i need some help that is not really related to the video.
    I want to draw out an entire array of objects but the draw function wont take in an array of double pointers, what do i do?

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

    Hey! Do you have any idea why I get the console opens but it says "Failed to deactivate shared context before sharing: The handle is invalid.
    Warning: The created OpenGL context does not fully meet the settings that were requested
    Failed to activate the window's context"? Been trying to set up SFML for a quite some time now , finally got it running but keep getting this error.

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

    Error: 'bool Collider::CheckCollision(Collider &,sf::Vector2f &,float)': cannot convert argument 1 from 'Collider' to 'Collider &'

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

    Will continue? Or is there a continuation?

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

    You just hit 800 subs and I'm the 800th #before1k

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

    Come back to us!

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

    can zou make continue

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

    hey, I have a problem with the collision detection I think. Once my player touches the platform it starts to jitter and I can't move in any direction (I can still jump though).

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

      Hello, have you fixed that :<
      Im stucks and im desparated now
      Tho my english isnt good but can you help me pls :')?

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

    How about some more Hilze?

  • @iceblue7147
    @iceblue7147 5 років тому +1

    this tutorial help me a lot thank you. Someone can help me how to add menu page to it?

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

      Make state machine and update only actual state in game loop

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

      have a look at my channel. there is a complete sfml state machine app in the description of the newest video

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

    Hi.. I will be very happy if you answer this one.. I made a game and I want to share it. I tried but it gave me some .dll errors. Can you help me?? (and it doesn't give errors on my PC it gives errors in other computers)

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

      +Ömer Gök Hi! It probably means that that person does not have the correct Visual C++ Redistributable. If you google the error that it gives you it will probably tell you for which version of Visual Studio he or she has to download it. Then download and install the Visual C++ Redistributable for the correct version of visual studio from Microsoft's website. That should fix it.

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

      I wanted to the player can easily start the game and play so he or she doesn't need to think about installing something.. But when you put the dll files into Debug it works!

  • @ubuntulearndev2938
    @ubuntulearndev2938 7 років тому +1

    Hello!
    Do you have any plans on creating 3D SFML tutorials?

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

    can you share please your source code? thanks in advance !

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

    I changed the greater than and less than symbols but I still can't jump twice. please help.

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

      If you want to be able to double jump. You should internally store an integer that increases every time you jump and your current jump count is less than 2. This integer should be set to 0 whenever the player collides with the ground.

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

      @@HilzeVonck he ment even after the greater than and less than symbols he cant jump more then once ,after jumping once and landing he cant jump again i have the same issue

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

    Anyone knows how can I make an invisible wall to limit create the boundaries of my game?

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

      The easiest way to keep the player within a rectangular play area is by using a method called 'claming'. When you clamp something, you keep it between an upper and a lower bound.
      You can use this method on the players position, to keep the player in a rectangular play area.
      Simply clamp both the X and Y position of the player and you're set!
      The clamp method is defined as follows:
      float Clamp (float min, float max, float value)
      {
      return std::fminf(max, std::fmaxf(min, value));
      }
      You might have to change the name of min and max if windows is included.

  • @1nex
    @1nex 3 роки тому

    Anybody knows how to make same syntax higligthing as author of this video have&

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

    where are you mannnnnnnnnnnn

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

    See you in the next one... Sadge

  • @aakksshhaayy
    @aakksshhaayy 7 років тому +1

    It's been 10 months, are you busy?

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

    Can you make a video for sf::Touch you can develop sfml from mobile with cxx droid and Just 1.99 bucks for montly or Just 10.99 premium Just explain the movement

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

      I won't make a video on this, but it is not that difficult. It works quite similar to SF mouse, except that you have multiple mouse positions, that might not all be active at the same time. You can create a super basic circular movement pad like lots of mobile games have by simply taking the distance between your desired center and the current touch point and dividing this by the desired radius of the movement pad, ensuring that the length of this delta never exceeds one. When you start you can simply loop over all fingers, if one is active, do the circle check and break. Then you could also make it more dynamic by saving the touch position when the player initiates a touch and using that as center. Then you could store the touch ID instead of looping over it all the time. Then you could create different regions and by using the initial touch position assign a touch ID to a specific region. This way you can make multiple circular movement pads. After this you can use AABB vs point and circle vs point checks to create buttons.

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

      @@HilzeVonck thx

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

    and now make it multiplayer with the sfml networking module please :P

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

    эх

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

    i there an option to get whole code or project? I need it to school, i started making my game too late and i am really bad at it

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

    too low quality, can't see ..