Skip to content

Commit

Permalink
added two stages update_function
Browse files Browse the repository at this point in the history
  • Loading branch information
iLauncherDev committed Sep 18, 2024
1 parent c048284 commit 97c8c7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use multiplication instead mix color
do not draw objects off the screen
added globalLight
added two stages update_function

# 0.5.3
optimized zOrder and priority
Expand Down
7 changes: 6 additions & 1 deletion iLGE-2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -3272,8 +3272,9 @@ class iLGE_2D_Engine {
this.#requestAnimationFrame(this.start);
return;
}

if (typeof this.update_function === "function") {
this.update_function(this);
this.update_function(this, false);
}

if (this.#isPaused)
Expand Down Expand Up @@ -3327,6 +3328,10 @@ class iLGE_2D_Engine {
blocker_objects_with_collider_component
);

if (typeof this.update_function === "function") {
this.update_function(this, true);
}

this.#draw();

if (this.fps_limit > 0) {
Expand Down

0 comments on commit 97c8c7f

Please sign in to comment.