mirror of
https://github.com/LDDestroier/CC/
synced 2024-12-12 11:10:28 +00:00
Add color change when hitting border (#9)
This commit is contained in:
parent
82d3e236a1
commit
634dc7d7e1
@ -120,6 +120,8 @@ local render = function(colorReplace)
|
||||
end
|
||||
end
|
||||
|
||||
local color = math.random(1, 15)
|
||||
|
||||
local tick = function()
|
||||
scr_x, scr_y = term.getSize()
|
||||
xWall = scr_x - imgXsize + 1 - xMargin
|
||||
@ -129,11 +131,13 @@ local tick = function()
|
||||
|
||||
if floor(logo.x) == (1 + xMargin) or floor(logo.x) == xWall then
|
||||
logo.xvel = -logo.xvel
|
||||
color = math.random(1, 15)
|
||||
end
|
||||
if floor(logo.y) == (1 + yMargin) or floor(logo.y) == yWall then
|
||||
logo.yvel = -logo.yvel
|
||||
color = math.random(1, 15)
|
||||
end
|
||||
render()
|
||||
render(string.sub("0123456789abcdef", color, color))
|
||||
end
|
||||
|
||||
term.setBackgroundColor(colors.black)
|
||||
|
Loading…
Reference in New Issue
Block a user