Search found 281 matches

by RNavega
Sat Jan 09, 2021 4:28 am
Forum: Support and Development
Topic: Making a progression bar
Replies: 10
Views: 9892

Re: Making a progression bar

I think you can do this using Data objects, more specifically FileData, created by reading a file from disk with love.filesystem.newFileData . FileData is a subclass of Data, so you can know the amount of bytes that the loaded file data represents . You can also calculate the total bytes from all as...
by RNavega
Fri Dec 25, 2020 12:55 pm
Forum: General
Topic: Obstacles in game
Replies: 6
Views: 8395

Re: Obstacles in game

Also, if you imagine yourself making more complex games in the future, it'd be interesting to invest some time in making simpler games first that will give you an easier challenge in learning different techniques, design patterns and such. There are two cool articles talking about this, not specific...
by RNavega
Fri Dec 25, 2020 12:46 pm
Forum: General
Topic: Obstacles in game
Replies: 6
Views: 8395

Re: Obstacles in game

I am currently having trouble drawing random obstacle. I don't know how to write an algorithm that creates a obstacle that goes in my direction and crate new obstacle every few seconds. Hi. What have you tried already, can you show some code? The things you're asking are very simple, so maybe it's ...
by RNavega
Tue Dec 08, 2020 9:54 am
Forum: Support and Development
Topic: Need help with making surface of image clickable.
Replies: 10
Views: 10114

Re: Need help with making surface of image clickable.

You can see the same mistake in your other files. How about any time you write a " function somethingsomething() ", go ahead and already add the " end " that will close it, just so you don't forget that anything between the name and the end will belong to the body of that functio...
by RNavega
Tue Dec 08, 2020 9:50 am
Forum: Support and Development
Topic: Need help with making surface of image clickable.
Replies: 10
Views: 10114

Re: Need help with making surface of image clickable.

For every 'function' definition there needs to be an 'end' to close it. So when you do something like this: -- Call Backs -- function love.load() function Player.load() -- debug -- io.setvbuf('no') --Player Movement -- function love.update(dt) if love.keyboard.isDown('d') then Player.x = Player.x + ...
by RNavega
Wed Dec 02, 2020 9:26 pm
Forum: Support and Development
Topic: How to make smooth camera movement?
Replies: 6
Views: 5671

Re: How to make smooth camera movement?

Wow, that's a thorough analysis there. Thanks Pedro!
by RNavega
Wed Dec 02, 2020 9:22 pm
Forum: Support and Development
Topic: Need help with making surface of image clickable.
Replies: 10
Views: 10114

Re: Need help with making surface of image clickable.

When I want to print some debug string or number, I use the console. For this you need to create a conf.lua file with the 'console' attribute set to true, the opposite of this: https://github.com/RNavega/2DMeshAnimation-Love2D/blob/master/conf.lua#L2 Then add a... io.setvbuf('no') ...at the start of...
by RNavega
Sun Nov 29, 2020 8:21 pm
Forum: Support and Development
Topic: How to make smooth camera movement?
Replies: 6
Views: 5671

Re: How to make smooth camera movement?

I think the LERP in the form (a + (b-a)*t) is faster than the form (a*(1-t) + b*t) used in that function because there's one less multiplication op.
by RNavega
Sun Nov 22, 2020 9:54 pm
Forum: Support and Development
Topic: How to know if a object is [top|bottom|left|right] using another object?
Replies: 5
Views: 3895

Re: How to know if a object is [top|bottom|left|right] using another object?

You could have two functions, one for a horizontal comparison and another for vertical comparison. So for example the horizontal function just returns if the object is to the left, center, or right of the reference object.
by RNavega
Mon Nov 02, 2020 5:32 am
Forum: Libraries and Tools
Topic: Groverburger's 3D Engine (g3d) v1.5.2 Release
Replies: 218
Views: 490548

Re: Groverburger's 3D Engine (G3D) New and Improved!

I don't see real-time or baked shadows in there, but I can see fog being used. This article explains how to implement fog with a shader: https://webglfundamentals.org/webgl/lessons/webgl-fog.html The fog factor can be the distance from the vertex to the camera (instead of just the depth of the verte...