local all the things
This commit is contained in:
@@ -16,8 +16,8 @@ local speed = 20
|
|||||||
local size = 3
|
local size = 3
|
||||||
|
|
||||||
function update(delta: number)
|
function update(delta: number)
|
||||||
x = x + speed * delta * x_direction
|
local x = x + speed * delta * x_direction
|
||||||
y = y + speed * delta * y_direction
|
local y = y + speed * delta * y_direction
|
||||||
|
|
||||||
if x <= size or x >= width - size then
|
if x <= size or x >= width - size then
|
||||||
x_direction = -x_direction
|
x_direction = -x_direction
|
||||||
@@ -27,9 +27,9 @@ function update(delta: number)
|
|||||||
y_direction = -y_direction
|
y_direction = -y_direction
|
||||||
end
|
end
|
||||||
|
|
||||||
color_x = (x / width) * 255
|
local color_x = (x / width) * 255
|
||||||
color_y = (y / height) * 255
|
local color_y = (y / height) * 255
|
||||||
color_z = 255 - (color_x + color_y) / 2
|
local color_z = 255 - (color_x + color_y) / 2
|
||||||
|
|
||||||
g13.set_color(color_x/2, color_y/2, color_z/2)
|
g13.set_color(color_x/2, color_y/2, color_z/2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user