Game States and Game Loops

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024
  • Part of a series on game programming. Visit codeschool.org

ความคิดเห็น • 20

  • @Gogglesofkrome
    @Gogglesofkrome 3 ปีที่แล้ว +4

    A hero to so few, but a hero no less. In other words... uh, thanks man. I hope you one day get the recognition you deserve

  • @PoisonWhisp3r
    @PoisonWhisp3r 8 ปีที่แล้ว +10

    unfair , so few views.. this is extremely helpful.. thank you !

  • @JZSNooB
    @JZSNooB 4 ปีที่แล้ว +3

    Dang this video is a masterpiece. I've come back to this video at multiple points in time in my relatively little time programming and learned something brand new each time. It's seriously a shame this getting the right treatment from the youtube algorithm. I think every aspiring game dev/programmer needs to see this!

  • @I_Lemaire
    @I_Lemaire 3 ปีที่แล้ว

    Thank you for this newb friendly and comprehensive explanation of a game loop.

  • @jayaganthan1
    @jayaganthan1 ปีที่แล้ว

    Awesome video. Thanks for making it!

  • @elneutrino90
    @elneutrino90 10 ปีที่แล้ว +3

    Ok so physics and collisions need regular intervals of time to function properly, I guess thats why, in ksp game, your chances to die when you're about to land, increase when you're using time warp

  • @Surkimus
    @Surkimus 11 ปีที่แล้ว +2

    Thank you so much for doing this. You've helped me a lot.

  • @seabass6106
    @seabass6106 4 ปีที่แล้ว

    Very helpfull! You have my undying grattitude for your explanation! 🖖

  • @briantwill
    @briantwill  12 ปีที่แล้ว +2

    Addendum: by default, a Pyglet window uses vsync, and because the run loop that drives schedule_interval performs the page flip, the update speed of any schedule_interval registered function will be limited by vsync, likely capping at something less than your refresh rate. (On my system, my refresh is 60hz, capping my updates to about 30 times per second.) To disable vsync, invoke window.set_vsync(False) on your window object. With vsync off, my update loop can run over 1000 times a second.

  • @markwright2408
    @markwright2408 8 ปีที่แล้ว +2

    You sir, made the game loop "click". ;)

  • @NathanSmutz
    @NathanSmutz 11 ปีที่แล้ว

    These are listed in order on codeschool.org/game-programming/
    I haven't found a native TH-cam playlist yet.
    Did I overlook one?

  • @mirlumerar4707
    @mirlumerar4707 9 ปีที่แล้ว

    This is awesome! Coming from the very simple and basic pygame event system this was exactly what could explain the idea behind pyglets event functions. I got one question, though: As I see things, the window event "on_draw" is only triggered whenever something is drawn on the window surface (or the window is created), triggered for example by a function dispatching a different event, or by a scheduled function. When I insert a print statement in the program at 21:24 behind "label.draw()", the message is printed exactly one, in a game that constantly updates state using a scheduled function it is printed out constantly as well. Has this changed in pyglet version 1.2?
    Thanks in advance,
    Mirlu Merar

    • @briantwill
      @briantwill  9 ปีที่แล้ว

      I'm rusty on pyglet as it got abandoned (which is one reason I never fully completed this series). I believe the example at 21:24 only prints once because pyglet won't redraw unless some other event has been triggered. With no events triggering, the state won't possibly have changed so the image won't need changing. Later, when we register an update function to the clock, Pyglet knows the window might need redrawing again. No idea if this differs in 1.2 vs earlier. Have I answered the question?

    • @mirlumerar4707
      @mirlumerar4707 9 ปีที่แล้ว

      Brian Will Thanks, this answered my question perfectly :)

  • @floppycooldog
    @floppycooldog 10 ปีที่แล้ว

    Good video thanks for this information. :)

  • @Darfail
    @Darfail 9 ปีที่แล้ว

    awesome tutorial

  • @handsome_man69
    @handsome_man69 8 ปีที่แล้ว +4

    so you do like OO?

    • @shipper66
      @shipper66 8 ปีที่แล้ว +4

      +Felix T-Rex lool :) not anymore i guess, this is old video :P