Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Nice! cool simple mechanics, challenging, nice art, I love the waves at the beginning, I'm curious about how you achieved it, they look so cool and the movement so natural. Overall great entry for the jam! 

Thanks! I used multiple sine waves combined together to create the waves at the beginning. By defining different variables like wave_height, wave_length, and water_spd I could control the look of the waves. In my case the water consist of 80 water tiles stacked side by side, and I simply draw the tiles one by one, where their tile index decides the sine waves' starting point (think when current_time is 0, then only the tile index (var tile) decides the y value of that tile. This ensures not all tiles are at the same height)


(current_time is the number of milliseconds since the game opened, so I divide by 1000 to convert to seconds)
The first wave has -current_time, so it moves in the opposite direction. Then the secondary sine waves are multiplied by a float, to make those waves longer and less defined. The result is that the first sine wave is much more obvious, while the other sines just disrupt a bit to help to make the motion less constant and more natural.


The water tile is just a simple sprite, so I could change its texture quickly if I wanted :)


Then finally the boat uses the same sine waves to make it bob up and down with the water. I also wanted make the player affect the waves, but didn't have time to implement it. Hope this helps! If you have any more questions I would be glad to answer :D

That is awesome! I figured the tile was an independent tile, but I was assuming you used some sort of train or snake algorithm, like everyone followed the movement of the "head". But sine waves make more sense. That's super cool, thanks for sharing!!

No problem :D 

A snake/train would probably be the best solution for making it dynamic though! Could probably combine the two solutions. So sine waves for the base waves, then add the snake on top for dynamic interaction with player 🤔

You could try it, but I think your solution will work better. Using sine waves give these random ups and downs, pseudo unpredictable movements, just like the ocean waves. A snake will make it move in a predictable way. I just think it will look better with sine waves. Good job!