Search found 1393 matches

by ivan
Thu Feb 14, 2019 7:06 pm
Forum: General
Topic: Hi, how to change forum password?
Replies: 2
Views: 47

Re: Hi, how to change forum password?

User control panel - profile - edit account settings
ucp.php?i=ucp_profile&mode=reg_details
by ivan
Sun Feb 10, 2019 8:49 am
Forum: Games and Creations
Topic: Mario Kart: Extreme Drift
Replies: 4
Views: 399

Re: Mario Kart: Extreme Drift

retrotails wrote:
Sun Feb 10, 2019 1:38 am
The game is licensed GPL v3, and the code is mine
The game looks cool, but I think somebody already has a license on Mario. :)
by ivan
Sun Feb 10, 2019 7:51 am
Forum: Libraries and Tools
Topic: A little library for convert colors
Replies: 5
Views: 320

Re: A little library for convert colors

It's a good try, but forum veteran Grump already beat you to it. You may want to look at his library for inspiration. Briefly going over the code, the "hex" function is not very good. There are more efficient ways to convert a hex value into RGB. For example, you can use tonumber specifically with b...
by ivan
Wed Feb 06, 2019 4:04 pm
Forum: General
Topic: Methods for accurately detecting collisions in a platformer?
Replies: 4
Views: 328

Re: Methods for accurately detecting collisions in a platformer?

Collision detection and response is a difficult problem. Collisions are usually resolved in pairs. With non-continuous collision detection, you want to resolve based on the "shortest separation vector". So it doesn't matter where the player is coming from, the important thing is, what is the shortes...
by ivan
Tue Feb 05, 2019 8:12 pm
Forum: Support and Development
Topic: [SOLVED] Avoiding callback hell
Replies: 6
Views: 486

Re: [SOLVED] Avoiding callback hell

What's the point of the nested closures?
Why not just:

Code: Select all

-- introduction after 5 seconds
qcall(5, events.say, "Hello")
-- move after 10 seconds
qcall(10, moveNpcRight)
qcall(11, stopNpc)
qcall(12, events.say, "I just moved to the right")
by ivan
Tue Feb 05, 2019 8:41 am
Forum: Support and Development
Topic: [SOLVED] Avoiding callback hell
Replies: 6
Views: 486

Re: [SOLVED] Avoiding callback hell

To be honest, your code doesn't look too good. I don't mean that as an insult, but it just isn't very clean. You don't need any libraries, I'll show you some alternatives: Event queues. This is the most simple technique that you can do in pure Lua. Queues are good if you want your code to be event b...
by ivan
Sun Feb 03, 2019 11:23 am
Forum: Libraries and Tools
Topic: lua utils
Replies: 28
Views: 9451

Re: lua utils

New polygon tutorial with interactive demos:
https://2dengine.com/?p=polygons
by ivan
Wed Jan 30, 2019 6:18 am
Forum: Support and Development
Topic: [SOLVED]love.physics world performance
Replies: 11
Views: 675

Re: love.physics world performance

AdrianN wrote:
Tue Jan 29, 2019 6:26 pm
Yes, I know, but the mechanics of my game is destroy the map.
It doesn't matter - you can still represent each tile square as a fixture and destroy the fixtures instead.
Bodies contain a lot of additional information which is wasteful in this application.
by ivan
Tue Jan 29, 2019 5:54 pm
Forum: Support and Development
Topic: [SOLVED]love.physics world performance
Replies: 11
Views: 675

Re: love.physics world performance

Looking at your screenshot I really hope each of those squares is not a separate body, right? That would explain the wasted memory. For static stuff you can put all of your fixtures in a single "ground" body (bodies can have multiple fixtures). Better yet - just use "edge shapes" to define the colli...
by ivan
Mon Jan 28, 2019 3:18 pm
Forum: Support and Development
Topic: [SOLVED]setDefaultFilter("nearest", "nearest") not working
Replies: 5
Views: 324

Re: setDefaultFilter("nearest", "nearest") not working

I think you need to set this per image as it will not work retroactively:
playerImg:setFilter("nearest", "nearest")