Page 1 of 1

[0.10.2 water-waves-v.0.1] - library for water waves creation

Posted: Wed Jun 20, 2018 9:52 pm
by azoyan
I am glad to show first version of water library for 0.10.2
Image

Usage example:

Code: Select all

local Water = require "water"

function love.load(arg)
  local x, y, width, height, color = 100, 150, 500, 400, { 0, 130, 200, 255 }
  water = Water(x, y, width, height, color)
end

function love.update(dt) water:update(dt); end

function love.mousemoved(x, y, dx, dy)
  local weight = 20
  local speed  = weight * dy
  if water:isTouched(x, y, dx, dy) then water:splash(x, speed); end
end

function love.draw() water:draw(); end
It is porting and implementation for love2d of water waves from this tutorial https://gamedevelopment.tutsplus.com/tu ... amedev-236

Source code raw water.lua https://raw.githubusercontent.com/azoya ... /water.lua

Welcome on GitHub: https://github.com/azoyan/water-waves-love2d

Example:
water.love
water waves example
(1.3 KiB) Downloaded 166 times

Re: [0.10.2 water-waves-v.0.1] - library for water waves creation

Posted: Fri Jun 22, 2018 8:58 am
by yetneverdone
Awesome! Add 11.0 compatibility and api please