Search found 34 matches

by idbrii
Thu Dec 30, 2021 9:08 pm
Forum: Support and Development
Topic: Distributing your games (making a .love file)
Replies: 278
Views: 956527

Re: Distributing your games (making a .love file)

whats a modern way of doing this? makelove works really well. If you have python, it's easy to install and use. I use it on Windows, but it builds for multiple platforms and on multiple platforms. You can even configure it to build for lovejs and host a server so you can test your lovejs build with...
by idbrii
Thu Dec 30, 2021 9:00 pm
Forum: Support and Development
Topic: Joystick:getName vs GamepadMappingString?
Replies: 1
Views: 1023

Joystick:getName vs GamepadMappingString?

Why doesn't Joystick:getName return the name of the gamepad from loadGamepadMappings? My USB-connected DualSense gamepad's name is reported as "Wireless Controller", but the GamepadMappingString is "PS5 Controller". Here's a simple demonstration main.lua (requires you download ht...
by idbrii
Tue Jul 06, 2021 10:50 pm
Forum: Support and Development
Topic: [SOLVED] Anim8 - Create animation for each new object
Replies: 12
Views: 14585

Re: [SOLVED] Anim8 - Create animation for each new object

The README says: > However that way you will get a submarine which "emerges", then "suddenly disappears", and emerges again. To make it look more natural, you must add some animation frames "backwards", to give the illusion of "submersion". Here's the complet...
by idbrii
Tue Jul 06, 2021 10:02 pm
Forum: Support and Development
Topic: getting started with love mac os, how to execute the love binary nside the application bundle directly
Replies: 3
Views: 6198

Re: getting started with love mac os, how to execute the love binary nside the application bundle directly

I think I installed love on macOS with brew and was able to use `love .` to run love in the current directory. My /usr/local/bin/love is a symlink to /Applications/love.app/Contents/MacOS/love, so I'm not sure why it doesn't work for you. Maybe try this: cd ~/path/to/mygame /Applications/love.app/Co...
by idbrii
Tue Jul 06, 2021 9:56 pm
Forum: Support and Development
Topic: Box2d questions and Moving box2d objects
Replies: 5
Views: 5404

Re: Box2d questions and Moving box2d objects

> So when an element with a random velocity hits an obstacle I want it to bounce to another directions. Reflecting momentum should be the default behaviour of box2d (unless you want to bounce to be a random direction?). Try using setLinearVelocity/applyLinearImpulse to set the *initial* movement of ...
by idbrii
Tue Jul 06, 2021 9:36 pm
Forum: Support and Development
Topic: Can't detect when mouse hovers over an object?
Replies: 6
Views: 4306

Re: Can't detect when mouse hovers over an object?

You could try refactoring your working code into a Hoverable class that you can use in both cases: Hoverable = Class{} function Hoverable:init(x, y, width, height) self.x = x self.y = y self.width = width self.height = height self.hot = false end function Hoverable:update(dt) local mx, my = love.mou...
by idbrii
Sat Jul 03, 2021 4:50 pm
Forum: Support and Development
Topic: How to put middleclass into a module?
Replies: 5
Views: 4747

Re: How to put middleclass into a module?

Check out the lua users tutorial on modules: http://lua-users.org/wiki/ModulesTutorial
by idbrii
Sat Jul 03, 2021 4:45 pm
Forum: Support and Development
Topic: How to measure garbage?
Replies: 3
Views: 5295

Re: How to measure garbage?

Ah, of course. I didn't think about the tostring that was happening inside Text:set! > Note how Löve generates garbage too. Moving the mouse, pressing keys, and probably other things will raise the count. That's what is not under your control. I guess not generating garbage shouldn't be my goal. Ins...
by idbrii
Fri Jul 02, 2021 5:08 pm
Forum: Support and Development
Topic: How to measure garbage?
Replies: 3
Views: 5295

Re: How to measure garbage?

Writing out that question helped me figure it out. You can collect garbage before measuring and use that to zero out other garbage so you only measure one specific function: local function measure_garbage(fn, ...) collectgarbage('collect') local tare = collectgarbage('count') collectgarbage('stop') ...
by idbrii
Fri Jul 02, 2021 4:55 pm
Forum: Support and Development
Topic: How to measure garbage?
Replies: 3
Views: 5295

How to measure garbage?

Is there a good way to measure how much garbage you're generating? It seems pretty trivial to put love in a state where the garbage alloc never stabilizes. Take this code: local time = 0 local text = { garbage = love.graphics.newText(love.graphics.getFont(), ''), time = love.graphics.newText(love.gr...