How can i make water in style of Meowy's adventure v1.3 by @mrLman
How can i make it in my game
Link OF My Game: https://microstudio.io/rianstar/joyultraadventure/
How can i make it in my game
Link OF My Game: https://microstudio.io/rianstar/joyultraadventure/
main file , draw function >
// draw animated water
local water1_height = sin(system.time()/1000) * 3
local water2_height = sin(system.time()/347) * 1.5
local water1_x_offset = (system.time() / 100) % 16
local water2_x_offset = (system.time() / 72) % 16
screen.drawMap("water" + level.number + "a", water1_x_offset - camera.x, -camera.y - 247 + water1_height, 70*16, 4*16)
screen.drawMap("water" + level.number + "b", water2_x_offset - camera.x, -camera.y - 255 + water2_height, 70*16, 4*16)
Water is a 70x4 pixel texture. It is animated by a sine function that cyclically moves the reference point in the x and y axes.