Показать сообщение отдельно
Старый 10.11.2011, 20:24   #50
barsunduk
ПроЭктировщик
 
Аватар для barsunduk
 
Регистрация: 09.05.2010
Адрес: рф ро шахты
Сообщений: 177
Написано 66 полезных сообщений
(для 271 пользователей)
Ответ: Помогите исправить ошибку

Сообщение от leonid Посмотреть сообщение
Со всем разобрался, но как исправить вторую проблему?
про то, что в конце карты должна быть пустая строка, забыл? нажми интер еще разок в конце текстового файла с картой и сохрани.

1211111111
1211111111
1211111111
1222211111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
// тут должна быть пустая строка


program lol;

var
    
ijxykeyinteger;
    
Sstring;
    
resresource;
    
land_image: array [1..2of image;
    
land_array: array [1..301..30of integer;
    
persimage;

begin
    land_image
[1] := loadimage('/land1.png');
    
land_image[2] := loadimage('/land2.png');
    for 
:= 1 to 30 do
    for 
:= 1 to 30 do
    
begin
        land_array 
[ij] := 1;
    
end;
    
res := openresource('/map.txt');
    for 
:= 1 to 10 do
    
begin
        S 
:= readline(res);
        for 
:= 1 to 10 do
            
land_array[ji] := stringtointeger(GetChar(S1));
    
end;
    
closeresource(res);
    
repeat
        setcolor
(255255255);
        
fillrect(00240320);
        for 
:= 1 to 10 do
        for 
:= 1 to 10 do
        
begin
            drawimage 
(land_image[land_array[ji]], (1) * 30, (1) * 30);
        
end;
        
pers := loadImage('/pers.png');
        
drawimage(persxy);
        
key := GetKeyPressed;
        if 
keytoaction(key) = GA_UP then
        begin
            y 
:= 1;
        
end;
        if 
keytoaction(key) = GA_DOWN then
        begin
            y 
:= 1;
        
end;
        if 
keytoaction(key) = GA_LEFT then
        begin
            x 
:= 1;
        
end;
        if 
keytoaction(key) = GA_RIGHT then
        begin
            x 
:= 1;
        
end;
        
repaint;
        
delay (40);
    
until (GetKeyPressed KE_KEY0);
end
__________________
to be or not to be - it's not a question!
2b or not 2b = ff
(Offline)
 
Ответить с цитированием