From bf2e8867f1a9481d52fb7fe7c4d67d1660ec97f2 Mon Sep 17 00:00:00 2001 From: Quinton Ashley Date: Mon, 24 Jul 2023 09:24:01 -0500 Subject: [PATCH] 1.2.3 --- lang/en/learn/sprite.md | 4 ++- lang/es/learn/sprite.html | 60 +++++++++++++++++++++------------------ lang/es/learn/sprite.md | 4 ++- lang/ja/learn/sprite.html | 44 +++++++++++++++------------- lang/ja/learn/sprite.md | 4 ++- learn/sprite.html | 54 +++++++++++++++++++---------------- package.json | 2 +- 7 files changed, 96 insertions(+), 76 deletions(-) diff --git a/lang/en/learn/sprite.md b/lang/en/learn/sprite.md index 0c782637..30f49149 100644 --- a/lang/en/learn/sprite.md +++ b/lang/en/learn/sprite.md @@ -382,9 +382,11 @@ Note that inside the sprite's draw function the center of the sprite is translat This mini example rotates the sprite's ellipse to the direction it's moving and makes the ellipse stretch in that direction proportional to it's speed. Kind of complicated! +# 12-1 + ## Custom Update -You can also define a custom update function for a sprite that runs at the end of the draw loop or when updateSprites is called. You can put any sprite specific behavior you want in there. +You can also define a custom `update` function for a sprite that runs at the end of the draw loop or when updateSprites is called. You can put any sprite specific behavior you want in there. # 13-0 diff --git a/lang/es/learn/sprite.html b/lang/es/learn/sprite.html index 731bed60..1dcce58e 100644 --- a/lang/es/learn/sprite.html +++ b/lang/es/learn/sprite.html @@ -1608,33 +1608,39 @@
-

Dibujo personalizado

-

- A veces no podrás usar animaciones predibujadas para obtener el tipo - de efecto visual que quieres para un sprite en movimiento. -

-

- Afortunadamente, puedes personalizar la función - draw del sprite y hacer que muestre cualquier cosa que - quieras! -

-

- Ten en cuenta que dentro de la función de dibujo del sprite, el - centro del sprite se traduce a la posición (0, 0). -

-

- Este mini ejemplo rota la elipse del sprite en la dirección en la - que se está moviendo y hace que la elipse se estire en esa dirección - proporcionalmente a su velocidad. ¡Un poco complicado! -

-

Actualización personalizada

-

- También puedes definir una función de actualización personalizada - para un sprite que se ejecuta al final del bucle de dibujo o cuando - se llama a updateSprites. Puedes poner cualquier comportamiento - específico del sprite que quieras allí. -

-
+
+

Dibujo personalizado

+

+ A veces no podrás usar animaciones predibujadas para obtener el + tipo de efecto visual que quieres para un sprite en movimiento. +

+

+ Afortunadamente, puedes personalizar la función + draw del sprite y hacer que muestre cualquier cosa + que quieras! +

+

+ Ten en cuenta que dentro de la función de dibujo del sprite, el + centro del sprite se traduce a la posición (0, 0). +

+

+ Este mini ejemplo rota la elipse del sprite en la dirección en la + que se está moviendo y hace que la elipse se estire en esa + dirección proporcionalmente a su velocidad. ¡Un poco complicado! +

+
+

+ Actualización personalizada +

+

+ También puedes definir una función update de + actualización personalizada para un sprite que se ejecuta al final + del bucle de dibujo o cuando se llama a updateSprites. Puedes + poner cualquier comportamiento específico del sprite que quieras + allí. +

+
+
-

カスタム描画

-

- スプライトの動きに対して求める視覚効果を得るために、事前に描かれたアニメーションを使用できない場合があります。 -

-

- 幸いなことに、スプライトのdraw関数をカスタマイズして、任意の表示を行うことができます! -

-

- スプライトの draw 関数内部では、スプライトの中心が位置(0, - 0)に移動されることに注意してください。 -

-

- このミニ例では、スプライトの楕円を移動方向に回転させ、その方向に比例して楕円を伸ばします。これはちょっと複雑です! -

-

カスタムアップデート

-

- また、描画ループの終わりまたは updateSprites - が呼ばれたときに実行されるスプライトのカスタムアップデート関数を定義することもできます。そこには、任意のスプライト固有の振る舞いを入れることができます。 -

-
+
+

カスタム描画

+

+ スプライトの動きに対して求める視覚効果を得るために、事前に描かれたアニメーションを使用できない場合があります。 +

+

+ 幸いなことに、スプライトのdraw関数をカスタマイズして、任意の表示を行うことができます! +

+

+ スプライトの draw 関数内部では、スプライトの中心が位置(0, + 0)に移動されることに注意してください。 +

+

+ このミニ例では、スプライトの楕円を移動方向に回転させ、その方向に比例して楕円を伸ばします。これはちょっと複雑です! +

+
+

カスタムアップデート

+

+ また、描画ループの終わりまたは + update + が呼ばれたときに実行されるスプライトのカスタムアップデート関数を定義することもできます。そこには、任意のスプライト固有の振る舞いを入れることができます。 +

+
+
-

Custom draw

-

- Sometimes you won't be able to use pre-drawn animations to get the - kind of visual effect you want for a sprite in motion. -

-

- Fortunately, you can customize the sprite's - draw function and make it display anything you want! -

-

- Note that inside the sprite's draw function the center of the sprite - is translated to position (0, 0). -

-

- This mini example rotates the sprite's ellipse to the direction it's - moving and makes the ellipse stretch in that direction proportional - to it's speed. Kind of complicated! -

-

Custom Update

-

- You can also define a custom update function for a sprite that runs - at the end of the draw loop or when updateSprites is called. You can - put any sprite specific behavior you want in there. -

-
+
+

Custom draw

+

+ Sometimes you won't be able to use pre-drawn animations to get the + kind of visual effect you want for a sprite in motion. +

+

+ Fortunately, you can customize the sprite's + draw function and make it display anything you want! +

+

+ Note that inside the sprite's draw function the center of the + sprite is translated to position (0, 0). +

+

+ This mini example rotates the sprite's ellipse to the direction + it's moving and makes the ellipse stretch in that direction + proportional to it's speed. Kind of complicated! +

+
+

Custom Update

+

+ You can also define a custom update function for a + sprite that runs at the end of the draw loop or when updateSprites + is called. You can put any sprite specific behavior you want in + there. +

+
+