Ответ: Помогите исправить ошибку
а код вставил?
секунду, а зачем в коде вот это (выделено жирным)?
program lol;
var
i,j,x,y,key,:integer;
S:string;
res:resource;
land_image:array [1..2] of image;
land_array:array [1..30,1..30] of integer;
pers:image;
begin
land_image[1]:=loadimage('/land1.png');
land_image[2]:=loadimage('/land2.png');
for i:=1 to 30 do
for j:=1 to 30 do
land_array [i,j]:=1;
res:=openresource('/map.txt');
for i:=1 to 10 do
begin
S:=readline (res);
land_array[j,i]:=stringtointeger(GetChar(S,j-1));
end;
closeresource (res);
REPEAT
setcolor(255,255,255);
fillrect(0,0,240,320);
for i:=1 to 11 do
for j:=1 to 9 do
begin
drawimage (land_image[land_array[j+,i+]],(j-1+)*30-,(i-1)*30);
end;
drawimage (pers,50,40);
key:=GetKeyPressed;
if keytoaction(key)=GA_UP then
begin
y:=y-1;
end;
if keytoaction(key)=GA_DOWN then
begin
y:=y+1;
end;
if keytoaction(key)=GA_LEFT then
begin
x:=x-1;
end;
if keytoaction(key)=GA_RIGHT then
begin
x:=x+1;
end;
repaint;
delay (20);
UNTIL (GetKeyPressed=KE_KEY0);
end.
__________________
Мечта программиста: запрограммировать процесс программирования.
Всё гениальное - просто.
http://passcall.ucoz.com
|