ソースを参照

early gameplay

some ideas that don't fit together
voltcitron 1 年間 前
コミット
8f0217ba62
4 ファイル変更36 行追加7 行削除
  1. 2 0
      .gitignore
  2. 6 6
      main.lua
  3. 27 0
      progress.lua
  4. 1 1
      ui.lua

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+
+*.lnk

+ 6 - 6
main.lua

@@ -16,6 +16,7 @@ function love.load()
   Lume = require("lume")
   loadGame()
   require("ui")
+  require("progress")
   require("data")
 
   local stoneShow = Stones
@@ -47,9 +48,8 @@ function love.draw()
 
   -- DRAW CRAFTERS
   -- ===========================
-  for i=1, #crafter do
-    local crft = crafter[i]
-    
+  for i,crft in ipairs(crafter) do
+
     if crft.active then
       love.graphics.setColor(colorOrange)
       love.graphics.rectangle(
@@ -104,9 +104,9 @@ end
 
 function love.mousereleased(x, y, button)
   if button == 1 then
-    for i=1, #crafter do
-      if checkRect(crafter[i].ui) then
-        upgradeCrafter(crafter[i])
+    for i,crft in ipairs(crafter) do
+      if checkRect(crft.ui) then
+        upgradeCrafter(crft)
       end
     end
   end

+ 27 - 0
progress.lua

@@ -0,0 +1,27 @@
+-- COMES BEFORE DATA.LUA
+
+
+Types = {}
+
+
+function doType()
+	-- -- -- reqlvl, name, rarity
+	local dirt = {0, "Dirt", 1}
+	local ston = {0, "Stone", 0.8}
+	local clay = {0, "Clay", 0.6}
+	local sand = {0, "Sand", 0.4}
+end
+
+function grade(type)
+	local grade = math.random(100)
+	if grade < 70 then
+		g = "common"
+	elseif grade < 88 then
+		g = "uncommon"
+	elseif grade < 98 then
+		g = "rare"
+	else
+		g = "unique"
+	end
+	return g
+end

+ 1 - 1
ui.lua

@@ -3,7 +3,7 @@
   colorBlack = {0, 0, 0, 1}
   colorGrey = {0.5, 0.5, 0.5, 1}
   colorWhite = {1, 1, 1, 1}
-  colorBlue = {0.2, 0.4, 1, 1}
+  colorBlue = {0.3, 0.5, 1, 1}
   colorOrange = {1, 0.8, 0.1, 1}
 
 buylist = {}