Search found 59 matches

by TheHUG
Sun Sep 13, 2020 7:38 pm
Forum: Support and Development
Topic: Getting a key as a number
Replies: 8
Views: 830

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: 1412

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: 1412

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: 537

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: 1060

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: 3392

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: 2134

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: 2134

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.
by TheHUG
Sat Jul 20, 2019 9:11 am
Forum: Support and Development
Topic: Trace a curve which pass through all of the points.
Replies: 8
Views: 2048

Re: Trace a curve which pass through all of the points.

Whatever my girlfriend's svg editing software used for it's curves ( which it did call bezier) does pass through all the points, so I was also surprised by this. I spent some time looking for this, and I didn't find anything. I think you'll need to come up with it yourself. I was thinking of doing i...
by TheHUG
Sat Jul 13, 2019 6:22 pm
Forum: Support and Development
Topic: Object inheritance
Replies: 26
Views: 4613

Re: Object inheritance

That's a pretty good idea