If your code is too slow to process X seconds of game logic in less than X real seconds, then your code is bad, so I don't see how that's related.
You did not read that article, nor did you read the code example, apparently, because what you are writing just isn't correct.
My baseless assumptions were that I can count seconds with delta time. I think that's kind of /the point/ of it existing - measuring time. Having a higher resolution timer has nothing to do with this, it would still change over time.
Rants + suggestions
Re: Rants + suggestions
Okay, I actually read the article. Before I did to me it looked like you propose some advanced overblown methods to deal with simple problems, just not good enough. Now, to me it looks that you had zero knowledge on the topic in question and then read some random-noname-man's-on-the-internet article and now you're super-convenient that your (his) points are super-valid. Danning - Kruger effect.
Re: Rants + suggestions
I personally never felt the need to do all that fancy stuff with fixed timestep. I just set a timestep limit to prevent things flying offscreen. Something as simple as dt = math.max(dt,1/30) usually does the job.
As for the tile map thing. Why not use tables so you can access like tile = map[x][y]? Your method makes it difficult to iterate through a map because the coordinates are stored as "x,y".
As for the tile map thing. Why not use tables so you can access like tile = map[x][y]? Your method makes it difficult to iterate through a map because the coordinates are stored as "x,y".
Re: Rants + suggestions
OMFG WOW. I didn't payed any attention to that code, but now I did, and OMG is it ineffective. Now I'm completely convenient about Dunning-Kruger thing.
-
- Citizen
- Posts: 65
- Joined: Sat Dec 22, 2012 8:17 am
Re: Rants + suggestions
You can do that.markgo wrote:As for the tile map thing. Why not use tables so you can access like tile = map[x][y]? Your method makes it difficult to iterate through a map because the coordinates are stored as "x,y".
raidho36 wrote:Okay, I actually read the article. Before I did to me it looked like you propose some advanced overblown methods to deal with simple problems, just not good enough. Now, to me it looks that you had zero knowledge on the topic in question and then read some random-noname-man's-on-the-internet article and now you're super-convenient that your (his) points are super-valid. Danning - Kruger effect.
What a funny guy. Do explain yourself, because so far you didn't make much sense (and no, trying to troll online isn't validating anything).raidho36 wrote:OMFG WOW. I didn't payed any attention to that code, but now I did, and OMG is it ineffective.Now I'm completely convenient about Dunning-Kruger thing.
It's not advanced and not overblown, but it does deal with a simple problem.
Re: Rants + suggestions
Dude, seriously. I wasn't meant to get your butt hurt, but it just looks like what I said. Besides, you didn't even make a slightest attempt at getting my points, which are 1) perfectly valid and 2) make reasonable argument against. Approach you suggested has big flaws, too, and using it is a subject for big all-around debate, not just "it's cooler that way, let's employ it".
-
- Citizen
- Posts: 65
- Joined: Sat Dec 22, 2012 8:17 am
Re: Rants + suggestions
I wrote multiple times already, I don't understand the flaws you keep writing. Can you give an example?raidho36 wrote:Dude, seriously. I wasn't meant to get your butt hurt, but it just looks like what I said. Besides, you didn't even make a slightest attempt at getting my points, which are 1) perfectly valid and 2) make reasonable argument against. Approach you suggested has big flaws, too, and using it is a subject for big all-around debate, not just "it's cooler that way, let's employ it".
It's not "cooler", it solves a problem that I faced, and that lurks in any time based movement.
Using a high resolution timer here doesn't change the fact that some X time passed between frames, and this X is just not the same on every frame.
Re: Rants + suggestions
[quote="Santos"]Oops, sorry about that!
quote]
Your code is really quite nice.
Makes creating and using a spritesheet (atlas) really easy.
Rearranged things a bit so that to create an atlas all that is needed is:
and to draw a selected (sel) image from the atlas:
quote]
Your code is really quite nice.
Makes creating and using a spritesheet (atlas) really easy.
Rearranged things a bit so that to create an atlas all that is needed is:
Code: Select all
local at = require 'atlas'
function love.load()
at.make( 'stickmen' )
end
function love.update()
at.update()
end
function love.draw()
love.graphics.draw( at.sheet )
end
function love.keypressed( key )
if key == 'escape' then love.event.push( 'quit' ) end
at.keypressed( key ) -- save spritesheet when 's' key pressed
end
Code: Select all
at.load('spritesheet2.png','geometry2.txt')
love.graphics.drawq( at.sheet, at.geometries[sel], 730, 530, 0, 1, 1, at.size[sel][1]/2, at.size[sel][2]/2 )
Really neat code - good work Santos!
- Attachments
-
- atlas_demo.love
- An example of Santos' atlas code
- (152.07 KiB) Downloaded 124 times
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests