Search found 20 matches

by Vrx8
Sat Nov 11, 2017 9:15 am
Forum: Support and Development
Topic: cut out a part of a screen and draw it
Replies: 3
Views: 587

cut out a part of a screen and draw it

so its like print screen/capture screen, but only at a specific part of the screen, like capturing half part of the screen, and then draw it.. is it possible ?
by Vrx8
Sat Sep 16, 2017 11:26 am
Forum: General
Topic: merge all .dll file into single exe
Replies: 3
Views: 782

Re: merge all .dll file into single exe

alright
by Vrx8
Sat Sep 16, 2017 10:38 am
Forum: General
Topic: merge all .dll file into single exe
Replies: 3
Views: 782

merge all .dll file into single exe

is it possible and allowed ?
by Vrx8
Wed Sep 13, 2017 2:09 pm
Forum: General
Topic: get what angle an object is moving at ?
Replies: 5
Views: 962

Re: get what angle an object is moving at ?

Generally you would want to have discrete steps with some time in between because of minor inaccuracies and the really small change in position. The solution is trigonometry! The formula is: angle = math.atan2(dx, dy) Where dx and dy are the difference between pointA and pointB. dx = math.abs(x1 - ...
by Vrx8
Wed Sep 13, 2017 10:28 am
Forum: General
Topic: get what angle an object is moving at ?
Replies: 5
Views: 962

get what angle an object is moving at ?

for example.. i move my mouse to top left corner from the middle of the screen.. then my mouse is moving at 45 degree angle, but how do i get the value ?
by Vrx8
Tue Sep 12, 2017 11:17 am
Forum: General
Topic: checking if a value is not on table ?
Replies: 15
Views: 2249

Re: checking if a value is not on table ?

using raidho's method function love.load() tableq = {} for i=0, 10, 1 do table.insert(tableq, i) end a = 9 b = 0 end function love.update() for i,v in pairs(tableq) do if v ~= a then b = b + 1 end end if b ~= #tableq then b = 0 end end function love.draw() if b == #tableq then lg.print("a is not in ...
by Vrx8
Tue Sep 12, 2017 11:14 am
Forum: General
Topic: checking if a value is not on table ?
Replies: 15
Views: 2249

Re: checking if a value is not on table ?

found out a better way to do it for me.. using raidho's method load() tableq = {} for i=0, 10, 1 do table.insert(tableq, i) end a = 99 b = 0 end update() for i,v in pairs(tableq) do if v ~= a then b = b + 1 end end if b ~= #tableq then b = 0 end end function love.draw() if b == #tableq then lg.print...
by Vrx8
Tue Sep 12, 2017 10:58 am
Forum: General
Topic: checking if a value is not on table ?
Replies: 15
Views: 2249

Re: checking if a value is not on table ?

If you want to know if a value is inside the table, you might as well return the index. You should probably check if the search value is non-nil to prevent bugs: --- Finds the first occurrence in a list -- @param t Table -- @param s Search value -- @param o Starting index (optional) -- @return Nume...
by Vrx8
Mon Sep 11, 2017 11:26 am
Forum: General
Topic: checking if a value is not on table ?
Replies: 15
Views: 2249

Re: checking if a value is not on table ?

Oh yeah.. I also don't want to use any extra table to get the answer
by Vrx8
Mon Sep 11, 2017 11:21 am
Forum: General
Topic: checking if a value is not on table ?
Replies: 15
Views: 2249

checking if a value is not on table ?

for example:

Code: Select all

love.load()
a = 9
table = {}
for i=0, 10, 1 do
table.insert(table, i)
end
end

love.draw()
for i,v in pairs(table) do
if v ~= a then
--print something
end
end
end
so what i want to do here is to print something out only once if the value is not on table, how do i do it ?