Search found 1530 matches

by ivan
Tue Dec 03, 2019 12:26 pm
Forum: General
Topic: [Test]HTTPS support for Windows (NO libraries required)
Replies: 5
Views: 3129

Re: [Test]HTTPS support for Windows (NO libraries required)

This is a very fragile and hacky script but I like it. I could see myself using something like this as a crude scraper tool. Here I have cleaned up the code a little bit: local https = {} https.timeout = 0 https.js = [[ var script = %script%; var url = %url%; var method = %method%; var data = %data%...
by ivan
Wed Nov 27, 2019 9:22 am
Forum: Support and Development
Topic: Help with making a class library
Replies: 3
Views: 228

Re: Help with making a class library

Have not tested your code but it looks fine. I would set the metatable last:

Code: Select all

function Class:new()
  local obj = {}
  obj.__index = obj
  return setmetatable(obj, self)
end
This should prevent bugs if you are doing something weird in the parent class metamethods
by ivan
Sun Nov 24, 2019 3:04 pm
Forum: General
Topic: New to Lua, hi
Replies: 2
Views: 223

Re: New to Lua, hi

Welcome aboard.
There already is a love2d discord server:
https://discord.gg/rhUets9
by ivan
Sat Nov 23, 2019 7:45 am
Forum: Support and Development
Topic: How do objects in the game work properly with the time that the game runs?
Replies: 5
Views: 289

Re: How do objects in the game work properly with the time that the game runs?

For most games you are rarely going to have more than a few hundred sprites moving on the screen at the same time.
If you want to make large levels with thousands of objects then you absolutely have to partition the level into sections.
This is not easy to do in a clean, generic way.
by ivan
Thu Nov 21, 2019 6:05 am
Forum: Support and Development
Topic: How to calculate physical stats for a platformer game
Replies: 10
Views: 832

Re: How to calculate physical stats for a platformer game

applyForce divides the acceleration to apply, by the mass of the body, so you have to compensate for the mass in order to apply an acceleration. The problem with applyForce is illustrated by the formula: force = acceleration*mass acceleration = change in velocity/time where "time" is the amount of ...
by ivan
Wed Nov 20, 2019 3:55 pm
Forum: Support and Development
Topic: How to calculate physical stats for a platformer game
Replies: 10
Views: 832

Re: How to calculate physical stats for a platformer game

I wrote a calculator that can find the missing constants for you: https://2dengine.com/?p=platformers#Calculator Note that you need to input at least 2 of the following 4 constants: jump height, gravity, initial velocity and time to apex. The jump height you already know to be 24*2 (ideally you want...
by ivan
Sun Nov 17, 2019 1:17 pm
Forum: General
Topic: Coverage reports in LOVE
Replies: 9
Views: 824

Re: Coverage reports in LOVE

I'd rather test LuaJIT since that's what I'm deploying
When profiling, you will ALWAYS be profiling the Lua code, not the underlying binaries.
by ivan
Sat Nov 16, 2019 6:26 pm
Forum: General
Topic: Pulse screen to a beat [Solved]
Replies: 5
Views: 577

Re: Pulse screen to a beat

Beat detection is generally unreliable AND difficult to implement. You should make beats manually; make a simple tool that will allow you to synchronize beats with audio and export beat tracks. Then you can use these beat tracks together with audio tracks in game. Yes, you can build your game aroun...
by ivan
Sat Nov 16, 2019 6:13 pm
Forum: General
Topic: Pulse screen to a beat [Solved]
Replies: 5
Views: 577

Re: Pulse screen to a beat

I'm not an expert in this area but I have dabbled a little bit with rhythm-based gameplay and audio visualizations. For starters, you need to make sure that you understand the difference between beat detection and more simple ways of analyzing the raw audio input. For example this is an oscilloscope...
by ivan
Fri Nov 15, 2019 4:52 pm
Forum: General
Topic: Coverage reports in LOVE
Replies: 9
Views: 824

Re: Coverage reports in LOVE

Love2D uses LuaJIT so you have to make sure that tool is compatible with LuaJIT. I don't see LuaJIT mentioned anywhere in the docs. Generally speaking, profiling with LuaJIT is hard because it's super optimized and some hooks are not triggered at all. I would love to see a better way to profile Love...