Search found 1399 matches

by ivan
Thu Feb 21, 2019 5:35 pm
Forum: Support and Development
Topic: Opposite colors to the background
Replies: 10
Views: 160

Re: Opposite colors to the background

Yep, would be nice if these would be options; not sure whether GL and GL ES version intercompatibility is the barrier to this or not though. I'm surprised that Love2D doesn't support subtractive blending as described. I have used it in another framework and it's really cool when you get it working....
by ivan
Thu Feb 21, 2019 2:06 pm
Forum: Support and Development
Topic: Opposite colors to the background
Replies: 10
Views: 160

Re: Opposite colors to the background

An 'invert' blendmode would be useful to have.
This is by far the easiest way to do it and it doesn't require shaders.
It should be possible using the "subtract" blend mode but I've never been able to get it working in Love2D.
by ivan
Thu Feb 21, 2019 9:50 am
Forum: Support and Development
Topic: Saving top points/highscore without TSearial
Replies: 4
Views: 364

Re: Saving top points/highscore without TSearial

Zorg is correct, but it's easier to write:

Code: Select all

love.filesystem.write("data.sav", points)
...
points = love.filesystem.read("data.sav")
points = tonumber(points)
by ivan
Thu Feb 21, 2019 9:11 am
Forum: Libraries and Tools
Topic: lua utils
Replies: 29
Views: 10234

Re: lua utils

I don't claim to know a lot about multiplayer games, but I decided to write up a simple tutorial:
https://2dengine.com/?p=networking
by ivan
Wed Feb 20, 2019 6:45 pm
Forum: General
Topic: Performance - what are your standards?
Replies: 2
Views: 93

Re: Performance - what are your standards?

It's not really about running at high FPS, it's more about making sure the FPS is consistent. So it's often about dealing with occasional drops in the frame rate. I also do profiling which help pinpoint overall bottlenecks https://bitbucket.org/itraykov/profile.lua/src/master/ If my games can run sm...
by ivan
Sun Feb 17, 2019 6:10 pm
Forum: Support and Development
Topic: How to delta time properly?
Replies: 3
Views: 284

Re: How to delta time properly?

For "damping", I recommend the Box2D formula:

Code: Select all

velocity = velocity / (1 + damping*dt)
Where the damping coefficient is usually between 0-1
(it could be greater than 1 but then the movement looks float-y).
Further reading:
https://2dengine.com/?p=platformers#Damping
by ivan
Thu Feb 14, 2019 7:06 pm
Forum: General
Topic: Hi, how to change forum password?
Replies: 2
Views: 202

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

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

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

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...