its very hard to understand ,why not 3,5 citcle,

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
sura
Prole
Posts: 3
Joined: Tue Feb 03, 2015 9:59 am

its very hard to understand ,why not 3,5 citcle,

Post by sura »

Code: Select all


--[[
猜古诗游戏
]]

--定义每一个五变形的点坐标位置
startx=300
starty=200
circlerad=25
circleseg=1000
bulletsite={}
--需要画出的一排最小的数量
minnum=3




function love.load()
  
end

function love.draw()
      love.graphics.setBackgroundColor(213,213,200);--背景色
      love.graphics.setColor(300, 100, 100);--前景色
      --[[
      love.graphics.circle("line", startx, starty, circlerad, circleseg); 
      love.graphics.circle("line", startx+50, starty, circlerad, circleseg); 
      love.graphics.circle("line", startx+100, starty, circlerad, circleseg); 
      love.graphics.circle("line", startx, starty+50, circlerad, circleseg); 
      love.graphics.circle("line", startx+50, starty+50, circlerad, circleseg); 
      ]]
      --循环打印出圈圈
      for j=1,2 do
      for i=1,minnum do
         love.graphics.circle("line", startx+i*50, starty+(j-1)*50, circlerad, circleseg); 
      end
        minnum=minnum+2
      end
      

end

function love.update()
  
end


User avatar
Doctory
Party member
Posts: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: its very hard to understand ,why not 3,5 citcle,

Post by Doctory »

what the actual *bleep*
Muris
Party member
Posts: 131
Joined: Fri May 23, 2014 9:18 am

Re: its very hard to understand ,why not 3,5 citcle,

Post by Muris »

I used google translator to try to understand chinese comments, so I might be wrong but...

I tried my best to understand the problem, and I think you are wondering why it draws endless amount of circles. The problem is that you do not reset the minnum, so it keeps growing every time draw is being called.

Code: Select all

      
 
--[[
猜古诗游戏
]]

--定义每一个五变形的点坐标位置
startx=300
starty=200
circlerad=25
circleseg=30
bulletsite={}
--需要画出的一排最小的数量
minnum=3




function love.load()
 
end

function love.draw()
      love.graphics.setBackgroundColor(213,213,200);--背景色
      love.graphics.setColor(300, 100, 100);--前景色
      --[[
      love.graphics.circle("line", startx, starty, circlerad, circleseg);
      love.graphics.circle("line", startx+50, starty, circlerad, circleseg);
      love.graphics.circle("line", startx+100, starty, circlerad, circleseg);
      love.graphics.circle("line", startx, starty+50, circlerad, circleseg);
      love.graphics.circle("line", startx+50, starty+50, circlerad, circleseg);
      ]]
      --循环打印出圈圈

      minnum = 3 -- otherwise this keeps growing on every draw call.
      -- 1.st call: minnum = 3
      -- 2nd call minnum = 5
      -- 3rd call minnum = 7
      -- 4th call minnum = 9 ...
      for j=1,2 do
      for i=1,minnum do
         love.graphics.circle("line", startx+i*50, starty+(j-1)*50, circlerad, circleseg);
      end
        minnum=minnum+2
      end
     

end

function love.update()
 
end
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: its very hard to understand ,why not 3,5 citcle,

Post by Alexar »

:cool: it's really rare to see Chinese here, and i am a Chinese.
if u want some help, you can contact with QQ1643386616
~em i really dont follow your idea even i am a Chinese... :x
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests