31
Ask a Question / Re: Exlosion via image api dosn't work in one scene
« on: September 02, 2022, 06:22:59 am »
The problem is that the exploded parts of the actor are being attached to the screen, which uses on-screen coordinates. Using on-screen coordinates for this, though, will make it so the images don't move on the screen even if the camera moves. What you probably want to do instead, is attach the images to a layer.
In the collision event, just make the following change:
"attach image to screen" -> "attach image to to layer"
If you want to continue with on-screen coordinates instead, you would make these changes in the "attach image to screen" and "slide image by" blocks:
"x of 1st actor" -> "x (on screen) of 1st actor"
"y of 1st actor" -> "y (on screen) of 1st actor"
"x-center of 1st actor" -> "x (on screen) of 1st actor + half-width of 1st actor"
"y-center of 1st actor" -> "y (on screen) of 1st actor + half-height of 1st actor"
In the collision event, just make the following change:
"attach image to screen" -> "attach image to to layer"
If you want to continue with on-screen coordinates instead, you would make these changes in the "attach image to screen" and "slide image by" blocks:
"x of 1st actor" -> "x (on screen) of 1st actor"
"y of 1st actor" -> "y (on screen) of 1st actor"
"x-center of 1st actor" -> "x (on screen) of 1st actor + half-width of 1st actor"
"y-center of 1st actor" -> "y (on screen) of 1st actor + half-height of 1st actor"