Search found 2565 matches

by pgimeno
Sun Apr 18, 2021 12:07 pm
Forum: General
Topic: My Function isn't activating, please help
Replies: 2
Views: 11

Re: My Function isn't activating, please help

I am trying to make a flappy bird replica but my "createrec" function does not seem to work... It is very possible that it is a different problem because as my name suggests, I am very bad. This is the code: function love.load() love.physics.setMeter(64) world = love.physics.newWorld(0, 9...
by pgimeno
Sun Apr 18, 2021 11:56 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 9
Views: 191

Re: Efficiently drawing a grid map

You can certainly generate the atlas at load time, if that's what you're asking. Even a canvas would work.
by pgimeno
Sun Apr 18, 2021 2:19 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 9
Views: 191

Re: Efficiently drawing a grid map

If you had a dungeon crawler that doesn't scroll very fast, would it help to draw all the floor tiles first then all the walls then all the doors etc? In other words, don't blindly draw left to right and causing a lot of swapping? If you have all floor tiles in a single texture atlas, all the walls...
by pgimeno
Sat Apr 17, 2021 5:47 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 9
Views: 191

Re: Efficiently drawing a grid map

I'm not hitting a bottleneck, just done with the map, so now I'm thinking on optimization... Planning on using a texture atlas in advance would have saved you some work. Don't believe the tale about "premature optimization blah blah". Misuse of that adage is the root of all evil. 1)So wil...
by pgimeno
Sat Apr 17, 2021 11:38 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 9
Views: 191

Re: Efficiently drawing a grid map

A texture atlas is the way to speed it up. SpriteBatch is made mostly for this kind of usage, and requires a texture atlas. Thnx, now I know it's possible, but how? 1)Any pointers/references on the use for this type of thing? 2) Will it make the game faster? 1) https://love2d.org/wiki/Tutorial:Effi...
by pgimeno
Sat Apr 17, 2021 11:33 am
Forum: Games and Creations
Topic: Commodore 64 emulator
Replies: 1
Views: 80

Re: Commodore 64 emulator

Wow.
by pgimeno
Sat Apr 17, 2021 10:56 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 9
Views: 191

Re: Efficiently drawing a grid map

A texture atlas is the way to speed it up. SpriteBatch is made mostly for this kind of usage, and requires a texture atlas.
by pgimeno
Sat Apr 17, 2021 10:52 am
Forum: General
Topic: What if I distribute an exe without cleaning the console?
Replies: 4
Views: 154

Re: What if I distribute an exe without cleaning the console?

It has potential to make the application slower. You can disable print() just in case:

Code: Select all

function print() end
by pgimeno
Fri Apr 16, 2021 4:38 pm
Forum: Support and Development
Topic: Why doesn't Font.getHeight() work the same as Font.getWidth()?
Replies: 3
Views: 111

Re: Why doesn't Font.getHeight() work the same as Font.getWidth()?

If you use love.graphics.print, the total height is the number of lines (number of \n + 1) multiplied by Font:getHeight(). If you use love.graphics.printf, you can get the number of final lines by taking the number of elements present in the second return value of Font:getWrap . Multiplying that by ...
by pgimeno
Fri Apr 16, 2021 11:07 am
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 4
Views: 192

Re: Coordinates for lines vs points (and pixel grid alignment for points)

Well, I was wrong, but not by much. As it turns out, the rounding depends on whether the line is horizontal or vertical, and there are good reasons for that. First, let's talk about filled rectangles. Rectangles don't have the same problems as lines, because they have an edge. You place the top left...