init all-in-one-bad
This commit is contained in:
commit
06d3384ca3
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.lua
|
5
src/conf.moon
Normal file
5
src/conf.moon
Normal file
@ -0,0 +1,5 @@
|
||||
love.conf = (t) ->
|
||||
t.window = {}
|
||||
t.window.width = 512
|
||||
t.window.height = 512
|
||||
return t
|
28
src/main.moon
Normal file
28
src/main.moon
Normal file
@ -0,0 +1,28 @@
|
||||
sea_level = 0.70
|
||||
ocean_blue_start = 0.20
|
||||
foam_start_level = 0.25
|
||||
w, h = love.graphics.getDimensions!
|
||||
|
||||
love.draw = ->
|
||||
for x = 1, w
|
||||
for y = 1, h
|
||||
R, G, B = 0, 0, 0
|
||||
precipitation_percentage = x / w
|
||||
height_percentage = y / h
|
||||
if height_percentage < sea_level
|
||||
sea_percentage = height_percentage / sea_level
|
||||
B = ocean_blue_start + sea_percentage * (1 - ocean_blue_start)
|
||||
if sea_percentage > (1 - foam_start_level)
|
||||
foam_percentage = (sea_percentage - (1 - foam_start_level)) / foam_start_level
|
||||
R = foam_percentage * 0.90
|
||||
G = R
|
||||
-- else
|
||||
-- G = precipitation_percentage * 0.15
|
||||
love.graphics.setColor R, G, B, 1
|
||||
else
|
||||
love.graphics.setColor 0, 1, 0, 1
|
||||
love.graphics.points x, y
|
||||
|
||||
love.keypressed = (key) ->
|
||||
if key == "escape"
|
||||
love.event.quit!
|
Loading…
Reference in New Issue
Block a user