Problem with scrolling image lazarus / 39-Graphics ---------------------------------------------------------------------- ITomi · 2021-01-19 09:14 Hello everybody! I'm still new here and in the world of Lazarus. I started to develop a game, in which there is a larger bitmap on the Form1. You can move this bitmap with the arrow buttons. But I have a big problem with this: I can't delete the graphical elements from the previous places, and so these pull a strip as you can see on the attached image. How can I delete the graphical components from the previouis places? The invalidate; command doesn't work with it. Pieces from my code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormCreate(Sender: TObject);begin  width:=Screen.width;  height:=Screen.height;  palyakep:=TBitmap.Create;  palyakep.SetSize(width*2,height*2);  palyakep.canvas.brush.color:=clblue;  palyakep.canvas.fillrect(0,0,width*2,height*2);(...)  palyafrissito:=TTimer.Create(nil);  palyafrissito.interval:=10;  palyafrissito.ontimer:=@palyafrissites; procedure TForm1.palyafrissites(Sender: TObject);begin//figures moving...with palyakep.canvas do invalidate; procedure TForm1.FormPaint(Sender: TObject);var puffalkepe: byte;  i: integer;begin  canvas.draw(palyakepx,palyakepy,palyakep);  for i:=0 to puffancsdb-1 do  begin    puffalkepe:=trunc(puffancs[i].iranya*8/360);    if puffalkepe>7 then puffalkepe:=0;    palyakep.canvas.draw(puffancs[i].x hely,puffancs[i].yhely,puffancskep[puffalkepe]);  end;end; ---------------------------------------------------------------------- Handoko · 2021-01-19 13:37 Hello ITomi, Welcome to the forum. Glad to find someone who is interested to develop games here. I want to provide you a detailed answer, unfortunately I'm a bit busy at the moment. You can download some simple demos, especially Pong Game, Game Map Editor, Simple Animation, Bullet and Asteroid Collision Detection, Moving Circles, Move a Shape With a Mouse on the Graphics category in the link below. Those should provide you some basic knowledge how to create games using Lazarus: https://wiki.freepascal.org/Portal:HowTo_Demos Have fun! ---------------------------------------------------------------------- ITomi · 2021-01-20 12:27 Hello and thanks, Handoko! I didn't know that "HowTo Demos" portal yet, but I will look it. Till this moment, I have only one small game written in Lazarus, and it can be found on my website: http://www.programozzunk.ucoz.hu/lazjatekok.html This is a simple space shooter: "Space defender". But now I would like make a real time strategy game, therefore I should know the technique to how can I draw images on a canvas bigger than canvas of TForm1. ---------------------------------------------------------------------- Handoko · 2021-01-21 02:57 Your Space Defender looks good. Please consider to showcase it on the wiki page: https://wiki.freepascal.org/Projects_using_Lazarus_-_Games Did you draw the graphics yourself? For the original issue, I remember there was a similar case. Maybe this thread can be useful to you: https://forum.lazarus.freepascal.org/index.php/topic,43985.msg308825.h tml#msg308825 ---------------------------------------------------------------------- ITomi · 2021-01-21 08:18 Thank you, Handoko!  The graphics origins from an old good shoot'em up game called "Tyrian". And thanks for your link! It seems to be similar problem like mine. I look closely it.