hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Event handling in the Game loop

    Scheduled Pinned Locked Moved
    Comments & Feedback
    5
    7
    383
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TutorialDoctorT
      TutorialDoctor
      last edited by

      We find ourselves using a timer set to 0 seconds to process behaviors on any given frame of the game loop.

      Any plans to allow us to make updates in the game loop without timers and the limits that comes with?

      1 Reply Last reply Reply Quote 1
      • HamedH
        Hamed Admin
        last edited by

        Timers of 0 is the game loop. Basically we just say don't do too much in your game loop because it will start lagging.

        1 Reply Last reply Reply Quote 0
        • GameCRAZYG
          GameCRAZY
          last edited by

          I never use 0. More like 0.1, rarely does it have to be that sudden...

          1 Reply Last reply Reply Quote 0
          • Aidan_FireA
            Aidan_Fire
            last edited by

            Depends on what you're doing, sometimes 0.1 is ok but sometimes it looks too rough for what you're trying to do. 3D was too laggy with 0s so I made it 0.1 with the moves taking 0.1 seconds to finish.

            Jack8680J 1 Reply Last reply Reply Quote 0
            • Jack8680J
              Jack8680 @Aidan_Fire
              last edited by

              @Aidan-Oxley yeah, if you want a transition or to draw something, you probably want it at timer 0 since that's 60 per second, same as the fps. You can also do timer(0.033) if you want it to be every second frame. Also, @Hamed, does the input for timer and wait get rounded to the nearest 60th, or does it run in between game ticks if we don't have a rational number?

              1 Reply Last reply Reply Quote 1
              • HamedH
                Hamed Admin
                last edited by

                It gets rounded.

                1 Reply Last reply Reply Quote 0
                • TutorialDoctorT
                  TutorialDoctor
                  last edited by TutorialDoctor

                  @Hamed Cool, so this is perfectly fine in Birds Eye View mode to simulate gravity or to even expand it to create your own physics setup at no additional cost nor advantage? I wonder what would happen if this were applied to a tag of physics objects.

                  0_1492528927191_IMG_2210.PNG

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post