User Tools

Site Tools


en:tutorials:clocks:clock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:tutorials:clocks:clock [2022/12/06 13:37 (2 years ago)] iarwainen:tutorials:clocks:clock [2024/04/20 14:22 (12 months ago)] (current) – Add priority level descriptions hcarty
Line 120: Line 120:
 This can be used in the exact same way to slow down monsters while the player will still move as the same pace, for example. This can be used in the exact same way to slow down monsters while the player will still move as the same pace, for example.
 There are other clock modifiers type but they'll be covered later on. There are other clock modifiers type but they'll be covered later on.
 +
 +===== Priority =====
 +
 +When setting up clock callbacks in orx, we need to specify a priority for the callback. This priority value specifies when a callback will occur during the execution within a given frame.
 +
 +  - Render all viewports/objects & emit all the draw calls (using the state of the previous frame), let the GPU work as early as possible (priority = HIGHEST)
 +  - Update inputs (physical polling w/ priority = HIGHER, input module w/ priority = HIGH)
 +  - (Scroll only) Game Update (if no Scroll, that's where one should likely put their logic as well, ie. priority = NORMAL)
 +  - Update all objects and linked structures (anim, sound, FX, etc., priority = LOW)
 +  - Update the physics simulation (priority = LOWER)
 +  - End the render frame, ask for presentation (priority = LOWEST)
  
 ===== Resources ===== ===== Resources =====
Line 127: Line 138:
 Config file: [[https://github.com/orx/orx/blob/master/tutorial/bin/02_Clock.ini|02_Clock.ini]] Config file: [[https://github.com/orx/orx/blob/master/tutorial/bin/02_Clock.ini|02_Clock.ini]]
  
-Video: [[http://www.youtube.com/watch?v=l9GuYhbtPzw|Video by acksys]]+Video by acksys{{youtube>l9GuYhbtPzw}}
en/tutorials/clocks/clock.1670362674.txt.gz · Last modified: 2022/12/06 13:37 (2 years ago) by iarwain