Advertisement
TangentFox

Example realistic star colors.lua

Sep 23rd, 2018 (edited)
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local type_color = {
  2.   O = {
  3.     0.521,
  4.     0.521,
  5.     0.996,
  6.     1
  7.   },
  8.   B = {
  9.     0.701,
  10.     0.898,
  11.     1,
  12.     1
  13.   },
  14.   A = {
  15.     1,
  16.     1,
  17.     1,
  18.     1
  19.   },
  20.   F = {
  21.     1,
  22.     0.996,
  23.     0.780,
  24.     1
  25.   },
  26.   G = {
  27.     0.988,
  28.     0.972,
  29.     0.250,
  30.     1
  31.   },
  32.   K = {
  33.     0.905,
  34.     0.549,
  35.     0.015,
  36.     1
  37.   },
  38.   M = {
  39.     0.847,
  40.     0.011,
  41.     0.031,
  42.     1
  43.   },
  44.   L = {
  45.     0.302,
  46.     0.187,
  47.     0.177,
  48.     1
  49.   }
  50. }
  51. love.draw = function()
  52.   local radius = love.graphics.getHeight() / 2
  53.   local x = 0
  54.   local _list_0 = {
  55.     "O",
  56.     "B",
  57.     "A",
  58.     "F",
  59.     "G",
  60.     "K",
  61.     "M",
  62.     "L"
  63.   }
  64.   for _index_0 = 1, #_list_0 do
  65.     local type = _list_0[_index_0]
  66.     love.graphics.setColor(type_color[type])
  67.     love.graphics.circle("fill", x, love.graphics.getHeight() / 2, radius)
  68.     x = x + radius
  69.     radius = radius / 1.75
  70.   end
  71. end
  72. love.keypressed = function(key)
  73.   if key == "escape" then
  74.     return love.event.quit()
  75.   end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement