Oh I understand the difference between Lazarus and FreePascal, I think haha.
From my understanding Lazarus uses FreePascal, and Lazarus version 1.4.4(which I was using before) was built using FreePascal 2.6.4.
Lazarus 1.6, which is the latest version, is the first one to use FreePascal 3.0.
Therefore I found it kinda confusing that the PXL site says they support Lazarus 1.4+.
But it's no big deal. The only important thing is that everything has been working perfectly fine ever since I switched to Lazarus 1.6.
Yeah, that makes a lot of sense.
Ok, thanks. I've spent more time looking at the timer, and I think I understand how it works now.
Yeah, I understand. I'm trying to limit the amount of advanced stuff I have to learn at once, so I'm hoping I won't have to learn multithreading too.
It shouldn't be a problem simply using the TMultimediaTimer. I just have to become a lot better at actually writing efficient code.
Yeah I noticed even small bits of lag in the graphics make a huge difference! That's actually what made me decide to look into using a graphics engine in the first place.
I tried to add an animated background, which I simply updated using a TTimer, but I noticed it was a bit inconsistent in it's updating. Probably because the code that created and updated the background only relied on my limited knowledge of basic LCL stuff.
Still, it ran smoothly enough, until I started adding more and more user interactivity. Right now my OnClick code is so inefficient that every time the player clicks somewhere, the background stops updating for 0.1 seconds.
It's really not much, but it's still very noticeable, and it's definitely something I can't have in the finished version of my game!
Once I've figured out how to use PXL correctly, I'll have to spend more time learning how to handle user input a lot better.
Thanks for the feedback! Like I've said, I really appreciate the help
---
All in all, I feel like I'm progressing well. There's still a lot of stuff I don't understand, but it still makes enough sense that I haven't had much problems learning it, so far.
My only problem right now is I can't find a good way to use sprites.
In my old code, the main game screen is split into a grid, where all squares are 24*24 pixels. And I have the pictures of everything that could appear on the screen, saved in a single large image.
Then, depending on what was supposed to be in a certain square, I simply used CopyRect to copy the appropriate(24*24) parts from a single large image I created.
However, I can't seem to find any way to copy a part of an image using PXL. There's a lot of different functions for deciding what(whole) image to use, and a lot of parameters to decide how to copy it, but I can't seem to find a way to simply use a small part of a large image.
Have I missed something, or do I have to save the graphics for every single thing in the game as a separate image?
---
Also, do you happen to know any open source games created using PXL, or one of it's similar predecessors? The samples that came with the library are pretty good, but they're all very simple, and none of them feature any sort of user interactivity.
I think I could learn a lot from simply seeing how someone else has used the graphics engine to create a playable game.
Bookmarks