Search found 75 matches

by RNavega
Thu Jan 14, 2021 2:13 pm
Forum: General
Topic: Randomly generating objects
Replies: 3
Views: 6479

Re: Randomly generating objects

Looks related to their thread about making a flappybird clone game, in here:
https://love2d.org/forums/viewtopic.php?t=90016
by RNavega
Sun Jan 10, 2021 12:39 am
Forum: Support and Development
Topic: [Solved] Pointing at an object that's out of sight
Replies: 14
Views: 8811

Re: [Solved] Pointing at an object that's out of sight

@pgimeno it's not pickiness xD , it's an important pointer. That point-slope code has special cases for when the player and enemy are perfectly aligned on the X or Y axes (so this prevents a division by zero, or when the slope 'm' results in zero itself), but for the case you mentioned of the player...
by RNavega
Sat Jan 09, 2021 6:10 am
Forum: Support and Development
Topic: [Solved] Pointing at an object that's out of sight
Replies: 14
Views: 8811

Re: [Solved] Pointing at an object that's out of sight

...I should add, I had the idea while looking at the diagrams drawn by Xugro above, so thanks for that!
by RNavega
Sat Jan 09, 2021 6:09 am
Forum: Support and Development
Topic: [Solved] Pointing at an object that's out of sight
Replies: 14
Views: 8811

Re: Pointing at an object that's out of sight

This task can be solved by casting 4 rays, each to an axis-aligned line. The formula for line-line intersection is very simple when one of the lines is axis-aligned. That's a cool solution pgimeno, very fast and elegant. The method I came up with when thinking of this is more verbose and I think sl...
by RNavega
Sat Jan 09, 2021 4:28 am
Forum: Support and Development
Topic: Making a progression bar
Replies: 10
Views: 7287

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

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

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

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

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

Re: How to make smooth camera movement?

Wow, that's a thorough analysis there. Thanks Pedro!