Hello, today I present to you my latest 10-minute project: Random Colour Madness!
Basicly it generate alot of different colours onto the screen. And it fits into a compact 1-2KB .love file!
Press any key to generate a new image. Have fun!
Random Colour Madness
Random Colour Madness
- Attachments
-
- ColourMadness.love
- (1 KiB) Downloaded 297 times
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Random Colour Madness
this is so cool, great job chuvak
Re: Random Colour Madness
I think using two loops to make a matrix is an overkill.
instead of
and
you should use :
and :
instead of
Code: Select all
for x = 0, map.height do
for y = 0, map.width do
love.graphics.setColor(map[x][y].red, map[x][y].green, map[x][y].blue)
love.graphics.rectangle("fill", x * 12, y * 12, 12, 12)
end
end
Code: Select all
for x = 0, map.height do
map[x] = {}
for y = 0, map.width do
map[x][y] = {}
map[x][y].red = math.random(0, 255)
map[x][y].blue = math.random(0, 255)
map[x][y].green = math.random(0, 255)
end
end
Code: Select all
for x = 0, map.height*map.width -1 do
love.graphics.setColor(map[x].red, map[x].green, map[x].blue)
love.graphics.rectangle("fill", (x % map.width)*12 , math.floor(x/map.height) * 12, 12, 12)
end
Code: Select all
for x = 0, map.height*map.width -1 do
map[x] = {}
map[x].red = math.random(0, 255)
map[x].blue = math.random(0, 255)
map[x].green = math.random(0, 255)
end
- Attachments
-
- cmr.love
- (1.76 KiB) Downloaded 183 times
http://darky-ben.fr/Xut my webcomic (french)
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests