Jupi Posted March 15, 2016 Share Posted March 15, 2016 agar.io سهلة طيب اعملها يا كنق و ورينا =) او عينة بسيطة علي الاقل Link to comment
</Mr.Tn6eL> Posted March 15, 2016 Share Posted March 15, 2016 اهداء الى صاحب الموضوع function isMouseInPosition(x, y, w, h) if isCursorShowing( ) then local cx, cy = getCursorPosition( ) return cx >= x and cx <= x+w and cy >= y and cy <= y+h end return false end function isMouseInCircle(x, y, r) local i = 0 for k=(-r), r do local q = math.sqrt((r/2)*(r/2)-k*k) if isMouseInPosition(x-q+(r/2), y+k+(r/2), 2*q, 1) then i = i+1 end end return i ~= (-r)+r end Link to comment
Jupi Posted March 15, 2016 Share Posted March 15, 2016 اهداء الى صاحب الموضوع function isMouseInPosition(x, y, w, h) if isCursorShowing( ) then local cx, cy = getCursorPosition( ) return cx >= x and cx <= x+w and cy >= y and cy <= y+h end return false end function isMouseInCircle(x, y, r) local i = 0 for k=(-r), r do local q = math.sqrt((r/2)*(r/2)-k*k) if isMouseInPosition(x-q+(r/2), y+k+(r/2), 2*q, 1) then i = i+1 end end return i ~= (-r)+r end اتحدي اذا فهم شيء من "isMouseInCircle" Link to comment
</Mr.Tn6eL> Posted March 15, 2016 Share Posted March 15, 2016 سويته شوي واصور لكم مقطع Link to comment
LoOs Posted March 15, 2016 Share Posted March 15, 2016 ياصاحب الموضوع أكد لي انك تقدر تسوي القيم مود الي انا بقوله لك ؟ صراحة اخاف تصير مثل ابن ميركل Link to comment
shwaeki Posted March 15, 2016 Share Posted March 15, 2016 اهداء الى صاحب الموضوع function isMouseInPosition(x, y, w, h) if isCursorShowing( ) then local cx, cy = getCursorPosition( ) return cx >= x and cx <= x+w and cy >= y and cy <= y+h end return false end function isMouseInCircle(x, y, r) local i = 0 for k=(-r), r do local q = math.sqrt((r/2)*(r/2)-k*k) if isMouseInPosition(x-q+(r/2), y+k+(r/2), 2*q, 1) then i = i+1 end end return i ~= (-r)+r end الكود تقريبا يمثل ربع المود بس الكود بجيب لاق خورافي خصوصا اذا حطة في لوب و الوب داخل الرندر Link to comment
</Mr.Tn6eL> Posted March 15, 2016 Share Posted March 15, 2016 صح فيه لاق لكن موب قوي لذيك الدرجة بس انا عدت بناء الكود اللي عندك وصار كذا function isPositionInPosition(x, y, w, h, cx, cy) return cx >= x and cx <= x+w and cy >= y and cy <= y+h end function isMouseInPosition(x, y, w, h) if isCursorShowing( ) then local cx, cy = getCursorPosition( ) return isPositionInPosition(x, y, w, h, cx, cy) end return false end function isPositionInCircle(x, y, r, cx, cy) local i = 0 for k=(-r), r do local q = math.sqrt((r/2)*(r/2)-k*k) if isPositionInPosition(x-q+(r/2), y+k+(r/2), 2*q, 1, cx, cy) then i = i+1 end end return i ~= (-r)+r end function isCircleInCircle(x, y, r, cx, cy, r2) local i = 0 for k=(-r), r do local q = math.sqrt((r/2)*(r/2)-k*k) if isPositionInCircle(cx, cy, r2, x-q+(r/2), y+k+(r/2)) then i = i+1 end end return i ~= (-r)+r end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now