Search found 61 matches

by TheHUG
Sat Oct 14, 2023 9:36 am
Forum: Libraries and Tools
Topic: Breezefield: a lightweight windfield alternative (love.physics wrapper)
Replies: 15
Views: 62480

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Hi, sorry for the late reply. `world:newCollider('Rectangle', {x, y, w, h, a})` would do the trick. Any args that would be passed to love.physics.<shape> can be put in that second argument. A-lox, breezefield wraps existing love2d physics functionality. To move a Collider, you can use any method you...
by TheHUG
Sun Jan 03, 2021 8:07 am
Forum: Libraries and Tools
Topic: Breezefield: a lightweight windfield alternative (love.physics wrapper)
Replies: 15
Views: 62480

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

I've implemented queryEdgeArea and fixed some bugs with querying.
by TheHUG
Sun Sep 13, 2020 7:38 pm
Forum: Support and Development
Topic: Getting a key as a number
Replies: 8
Views: 7317

Re: Getting a key as a number

Only way would be to make var[2] a number rather than a table (see grump's answer)
by TheHUG
Wed Jul 15, 2020 3:15 pm
Forum: Games and Creations
Topic: GMTK entry: SnogWars
Replies: 2
Views: 5287

Re: GMTK entry: SnogWars

I was just randomly playing when this happened at some point (I hope it's only because of the Evil Keyboard). Error drawTongue.lua:31: Cannot triangulate polygon. Traceback [C]: in function 'triangulate' drawTongue.lua:31: in function 'draw_tongue' main.lua:346: in function 'draw' [C]: in function ...
by TheHUG
Wed Jul 15, 2020 10:20 am
Forum: Games and Creations
Topic: GMTK entry: SnogWars
Replies: 2
Views: 5287

GMTK entry: SnogWars

by TheHUG
Wed Jul 15, 2020 10:07 am
Forum: Support and Development
Topic: Lua Class variables shared between objects
Replies: 3
Views: 3032

Re: Lua Class variables shared between objects

The problem is that in Rock:new() you're setting self.pos. `self` is the object called on - i.e. Rock. the table whose values you want to set is the one you named rock (which you really ought to declare as local btw!). The result is that both rock's .pos attrib reference Rock.pos. you make the same ...
by TheHUG
Thu Sep 26, 2019 3:25 pm
Forum: Support and Development
Topic: [Solved] Hump.camera + love.physics
Replies: 3
Views: 3051

Re: Hump.camera + love.physics

Another possible solution: If your camera is always centered on the player, then you can just setLinearVelocity() on the camera-stationary objects to be equal to that of the player (not sure what order love physics resolves force, acceleration, velocity, depending on that and how you move your playe...
by TheHUG
Mon Sep 16, 2019 6:52 am
Forum: Support and Development
Topic: Writing unit tests within love code
Replies: 9
Views: 7805

Re: Writing unit tests within love code

for tests where I need access to love functions I use: https://love2d.org/forums/viewtopic.php?t=75192

Another option would be to mock the functions you need
by TheHUG
Sat Aug 24, 2019 2:48 pm
Forum: Support and Development
Topic: Code review please
Replies: 8
Views: 5842

Re: Code review please

Ok, I wasn't sure if global or local took longer to load or something. What I'm creating is rather simple so having global variables shouldn't be an issue. Thanks! In this case, count, for example, is a global variable. In lua, unlike python, variable scope is global unless explicitly declared to b...
by TheHUG
Fri Aug 23, 2019 6:50 pm
Forum: Support and Development
Topic: Code review please
Replies: 8
Views: 5842

Re: Code review please

You have some one-letter variable names where it isn't immediately obvious what they are.
(Q, I ,f w, c), I think they'd be better off as full words.

Most coding standards agree that it is best to limit the number of characters per line to around 80 characters.