Fog
The humidity and the river create fog in the cave.
The humidity and the river create fog in the cave.
Save the image below
Save the image below
Use it for you new Fog
Use it for you new Fog
TILED BACKGROUND OBJECT
TILED BACKGROUND OBJECT
Set up the properties of the Tiled Background as shown.
Set up the properties of the Tiled Background as shown.
Scroll the Fog across the screen
Scroll the Fog across the screen
Code Explained:
Code Explained:
Every Tick: This means the action is performed on every frame update (which typically happens 60 times per second).
Self.ImageOffsetX: This refers to the current horizontal offset of the fog's image. It controls the position of the fog within the tiled background.
0.5 * 60 * dt:
0.5 is the speed at which the fog moves.
60 is used as a factor, likely to make the movement rate consistent at 60 frames per second (FPS).
dt stands for "delta time," which is the time since the last frame. It ensures that the movement speed is consistent across different frame rates (e.g., if the game slows down or speeds up, the fog moves at the same rate).
This code continuously shifts the fog image horizontally, creating the appearance of a moving fog.
Test your game to see the moving fog.
Test your game to see the moving fog.