The 2nd tutorial uses delay to achieve stable frame rate. It's okay, but I think the best one is using delta time. Because using delay has one noticeable disadvantage. That is, if the computer is tool slow to draw the frame, user will experience the lag.
Using delta time isn't perfect too. But the slowdown usually is less noticeable. Because if the frame rate drop, the movement is multiplied with the delta time. It is said, this is very important on multiplayer games (over network or internet), because you have to synchronize the position of the sprites without worry about the computers performance.
Ok that's a good point. I will try to start again with SDL from now with Lazarus.
@Manu
Your code is not easy to read, maybe you can put it at least in procedures and functions to structure it a bit.
the code shoulr look like this
begin
init
mainloop
finish
end
in the procedure mainloop you add the actual code with another 2 procedures at least
and that will be more easy to read.
if you want you can split your code into units, more easy to read, for example in one unit put the types, in other the input, in other the rendering.
Another suggestion:
Use GitHub to store your code, so you can keep and track your changes easily.