Fenris78
Abandoned Uranium Working
![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 16
|
Post by Fenris78 on Jul 9, 2024 15:44:06 GMT
Salud! He creado un TICKER en el evento "Init sprite" para crear un efecto de agua en la pantalla. En un principio funciona correctamente, pero he observado que aparecen glitches cuando se crea después algún nuevo objeto con SPAWN en la pantalla. Es como si perdiera algunos frames en el tiempo de dibujo y el texto (el agua) y se desplazara ligeramente. ¿Alguna idea de como evitar este glitch?
================
Cheers! I have created a TICKER in "Init sprite" event to create a water effect on the screen. At first it works correctly, but I noticed that it has glitches when creating a new object with SPAWN on the screen. It is as if it loses some frames in the drawing time and the text moves slightly. Any idea how to avoid this glitch?
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on Jul 9, 2024 17:08:46 GMT
When you put code in the init sprite event, it will get triggered when a sprite is created. When you SPAWN a new sprite, this will trigger the init code.
If your init sprite event has something like
TICKER 32 "This text will go from right to left and so on and so on..."
Then, every time a new sprite is SPAWNED it will call the TICKER message again. I would probably use one of the other variables (if you have a spare one) to track if the ticker is on or off
e.g.
;; init sprite code
IF A = 0 ; A is used to indicate the ticker has started. 0 = no, 1 = yes LET A = 1 TICKER 32 "Insert whatever it is here for endless fun" ENDIF
Then you'll have to make sure to set A to 0 when a screen is redrawn - hope that's all it needs.
|
|
Fenris78
Abandoned Uranium Working
![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 16
|
Post by Fenris78 on Jul 12, 2024 10:32:15 GMT
When you put code in the init sprite event, it will get triggered when a sprite is created. When you SPAWN a new sprite, this will trigger the init code. Thank you very much. I didn't realize that I was re-activating the ticker.
|
|