Search found 33 matches

by 4vZEROv
Mon Jul 15, 2019 8:47 pm
Forum: Libraries and Tools
Topic: Physics
Replies: 0
Views: 52

Physics

Since the most popular love.physics wrapper (aka. Windfield) is no longer maintained i've made mine:
I'm currently writing the documentation and i'll also make some demos.

https://github.com/4v0v/physics/
by 4vZEROv
Sat Jul 13, 2019 1:34 pm
Forum: Support and Development
Topic: [SOLVED] Using Push scaling library with SUIT GUI, can't align Mouse position
Replies: 4
Views: 115

Re: Using Push scaling library with SUIT GUI, can't align Mouse position

I don't use push but in the doc there are those functions that should do the trick Convert coordinates: push:toGame(x, y) --convert coordinates from screen to game (useful for mouse position) --push:toGame will return nil for the values that are outside the game - be sure to check that before using ...
by 4vZEROv
Sat Jul 13, 2019 8:09 am
Forum: Support and Development
Topic: What is setUserData and why do I need it?
Replies: 21
Views: 435

Re: What is setUserData and why do I need it?

It's not useless a all ! You can't directly set values to a body or a fixture (fixture.x = "hello").
I use it in my physics library if you wan't a real usecase :

https://github.com/4v0v/physics
by 4vZEROv
Mon Jul 08, 2019 3:57 pm
Forum: Support and Development
Topic: Object inheritance
Replies: 26
Views: 618

Re: Object inheritance

What I use : class.lua local Class = {} function Class:new() end function Class:extend() local obj = {} obj.__call, obj.__index, obj.super = self.__call, obj, self return setmetatable(obj, self) end function Class:__index(v) return Class[v] end function Class:__call(...) local obj = setmetatable({},...
by 4vZEROv
Tue Jun 18, 2019 5:36 pm
Forum: Support and Development
Topic: love2d seems to work fine, yet it doesnt respond
Replies: 13
Views: 1673

Re: love2d seems to work fine, yet it doesnt respond

Try using the zip version.
by 4vZEROv
Sun Jun 09, 2019 12:08 pm
Forum: Support and Development
Topic: Orbit object around another object using mouse position
Replies: 5
Views: 1930

Re: Orbit object around another object using mouse position

pgimeno in the game he gave, the object orbiting stay at the same distance all the time (see webm), I don't think you can get this result without normalizing the angle ?
by 4vZEROv
Sun Jun 09, 2019 9:37 am
Forum: Support and Development
Topic: Orbit object around another object using mouse position
Replies: 5
Views: 1930

Re: Orbit object around another object using mouse position

Trigonometry friend. function orbit(x,y, tx, ty, distance) local _x, _y = tx - x, ty - y local angle = math.atan2(_y, _x) return math.cos(angle)*distance + x, math.sin(angle)*distance + y end local a = {x = love.graphics.getWidth()/2, y = love.graphics.getHeight()/2} local mouse = {x = 0, y = 0} loc...
by 4vZEROv
Fri Jun 07, 2019 8:13 pm
Forum: Support and Development
Topic: [SOLVED] Dialog doesn't work on signs (I have no clue lmao)
Replies: 1
Views: 503

Re: Dialog doesn't work on signs (I have no clue lmao)

I tried but I don't understand how your code work, "txtt" become empty after ending the first conversation that's as far as I went.

You have globals everywhere and functions that call them without being passed as argument. Also your variable names are not easy to understand to say the least.
by 4vZEROv
Sun Jun 02, 2019 12:47 am
Forum: Support and Development
Topic: Some love features I think would be useful
Replies: 7
Views: 1717

Re: Some love features I think would be useful

I don't understand how this would be usefull, just use a variable to stock the previous key and voila ?
by 4vZEROv
Thu May 23, 2019 11:20 am
Forum: Support and Development
Topic: How to switch ipairs without having to rewrite?
Replies: 3
Views: 1717

Re: How to switch ipairs without having to rewrite?

do a function ?

Code: Select all

function loop(x)
	for i,v in ipairs(x) do 
		--stuff
	end
end
loop(opp)
loop(player)