Search found 1423 matches

by ivan
Sun May 19, 2019 1:56 pm
Forum: Support and Development
Topic: Networking over wifi
Replies: 2
Views: 119

Re: Networking over wifi

Might work if you setup your wifi as a local network where each device has a unique IP.
It won't work if you try to connect over the internet through wifi.
by ivan
Sun May 05, 2019 5:12 pm
Forum: Support and Development
Topic: Is there a way of saving and loading files from anywhere?
Replies: 13
Views: 563

Re: Is there a way of saving and loading files from anywhere?

I want to give that sensation of comfort of saving and loading files from anywhere to anywhere. Frankly speaking, I don't see anything "comfortable" in dealing with file dialogs, etc. In fact, most modern programs never ask you to browse around the device's filesystem. A good example would be apps ...
by ivan
Sun May 05, 2019 4:22 am
Forum: Support and Development
Topic: Is there a way of saving and loading files from anywhere?
Replies: 13
Views: 563

Re: Is there a way of saving and loading files from anywhere?

Is there a way of saving and loading files from anywhere? Like "C:\users\darlex\Desktop\project1" or "\home\darlex\desktop\project1"? "C:\" is a Windows thing and it won't work across platforms. You want your game to work on any device, right? Im trying to do a game editor thing but i dont know how...
by ivan
Wed May 01, 2019 11:15 am
Forum: Libraries and Tools
Topic: "profile.lua" a tool for finding bottlenecks
Replies: 25
Views: 7759

Re: "profile.lua" a tool for finding bottlenecks

Looks cool, somebody already managed to hookup Lua with KCacheGrind so it's definitely possible to produce more sophisticated visualizations/reports. Personally, I don't really need that sort of thing for now, but you are free to modify the code, and use it any way you like. Cheers!
by ivan
Tue Apr 30, 2019 7:11 pm
Forum: Libraries and Tools
Topic: "profile.lua" a tool for finding bottlenecks
Replies: 25
Views: 7759

Re: "profile.lua" a tool for finding bottlenecks

Thanks Przemator. It's certainly possible, but I'm not sure if it would be more useful. Consider the following example: Function Calls Time /foo 1 3.3 /foo/bar 2 3.2 /baz 1 1.6 /baz/bar 2 1.5 The "bar" function took 4.7 seconds of overall execution time but based on your suggestion "bar" would be di...
by ivan
Mon Apr 29, 2019 5:34 am
Forum: Support and Development
Topic: question about local and global [SOLVED]
Replies: 6
Views: 286

Re: question about local and global

Put simply: in the second example the 'x' variable cannot be accessed outside of the file because it's local.
by ivan
Thu Apr 25, 2019 4:53 am
Forum: Support and Development
Topic: Collision detection between bullets [SOLVED]
Replies: 5
Views: 2075

Re: Collision detection between bullets

pgimeno is right, you could remove the elements during iteration, as long as you iterate in reverse:

Code: Select all

for i = #list, 1, -1 do
  for j = i - 1, 1, -1 do
    if checkCollisions(list[i], list[j]) then
       table.remove(list, i)
       table.remove(list, j)
       break
    end
  end
end
by ivan
Thu Apr 25, 2019 4:33 am
Forum: Support and Development
Topic: Why is 2-2 = 8.8817841970013e-016
Replies: 6
Views: 1137

Re: Why is 2-2 = 8.8817841970013e-016

Also note that the precision will be incorrect for very large numbers too. You should be fine as long as you don't compare numbers directly, like a == b That's just how floating point math works. I don't recommend it, but I've seen things like: math.epsilon = 0.001 function isEqual(a, b) return math...
by ivan
Mon Apr 22, 2019 6:25 am
Forum: Support and Development
Topic: How to check if touch press is in a triangle [SOLVED]
Replies: 2
Views: 2131

Re: How to check if touch press is in a triangle

Point in triangle is a relatively simple check:
https://2dengine.com/?p=intersections#P ... e_triangle
If you want the touch area to be larger (circle) then it's slightly more complicated:
https://2dengine.com/?p=intersections#C ... s_triangle
by ivan
Wed Apr 10, 2019 4:30 am
Forum: Support and Development
Topic: How to create "darker" version of image?
Replies: 3
Views: 4080

Re: How to create "darker" version of image?

Your code looks fine in theory but drawing a black rectangle over the image might look incorrect if the texture is partially transparent. You could just use "setColor(0.5,0.5,0.5,1)" for the particular image.