Forum > Games

The plumps - a small RTS game in Lazarus

(1/7) > >>

Tomi:
Hello everybody!

I have started to make a small RTS game in Lazarus. It is not finished yet, but I can present some stuff about it for you. For example a picture at least, but I will publish the source code soon.
Its title is "The plumps" (maybe "Puffancsok" in hungarian) and you can control the little cute creatures of an alien planet in its fight against enemy.
So, what I completed till now with the game?
- Scrollable game field,
- A simple own algorithm to move units and avoid obstacles,
- Player can build some basic buildings.
I make the game purely in Lazarus, so nothing special like game engines or similar tools. Graphics made with Anim8or.
Now, I would like present you my first steps with this topic. If you can recommend me similar Lazarus games, so don't hesitate because I need all kinds of knowledge.

Tomi:
And ladies and gentelmen, here is the source code from my website:
http://www.programozzunk.ucoz.hu/lazjatekok/puffancsok.zip

Note that this game are in very early version, so this is a beta version. But try it; I hope, you will like my work and I hope, I can inspire you if you plan to make similar games.

Handoko:
Great! It works, even on Linux too.
Many things are still missing, but you made a good step.

I can move the creatures and create buildings. Unfortunately it run too fast on my PC. You can use a TTimer or run some codes to check the computer speed and do necessary delay. Also, I guess you have a large monitor. All the sprites seemed very large on my 1600x900 resolution monitor.

Just to warn you, using TCanvas to create games ... you will have performance issue later.

furious programming:
Use SDL — it is super simple to use and quite powerful. Dealing with LCL limitations in the terms of creating game is a waste of time.

Tomi:

--- Quote from: Handoko on March 19, 2022, 05:49:33 pm ---"it run too fast on my PC. You can use a TTimer or run some codes to check the computer speed and do necessary delay."

--- End quote ---

Hello Handoko!

Setting of correct game speed is always a big problem for me if there is no basic tools for this. But in this game I used TTimer at lines 1374-1376:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---palyafrissito:=TTimer.Create(nil);  palyafrissito.interval:=10;  palyafrissito.ontimer:=@palyafrissites;Maybe value 10 for interval is too small and the game is too fast because of it? Is there an optimal value to correct speed at all computers?

Navigation

[0] Message Index

[#] Next page

Go to full version