Я не помню насчёт Readkey. В простых графических программах, при опросе клавиатуры, делаю флаги указывающие произошедшее событие. Четыре события (up, left, right, down) и для них четыре флага, указывающие, что они были нажаты в данный момент времени.
Первое: вам надо убрать из "main" при опросе все "else" и опрашивать клавиши последовательно.
Второе: надо будет произвести выборку когда нажаты диаметрально противоположные клавиши и обнулить их.
Третье: вам нужна будет процедура, которая будет обрабатывать флаги с учётом произошедших событий.
При выполнении этих условий персонаж сможет двигаться по диагонали.
В вашем коде это надо дополнительно переделывать.
Тут есть одна проблема... Я в программах проверяю клавиши отжатия и отключаю флаги нажатий... как это будет происходить в данном случае?
if keyDown = Left then
flagLeft := true
else
flagLeft := false;
может быть в подобном варианте?
google translate:
I don't remember about the Readkey. In simple graphical programs, when polling the keyboard, I make flags indicating the event that occurred. Four events (up, left, right, down) and for them four flags indicating that they were pressed at a given time.
First: you need to remove all "else" from "main" when polling and poll the keys sequentially.
Second: it will be necessary to make a selection when diametrically opposite keys are pressed and reset them.
Third: you will need a procedure that will process the flags taking into account the events that have occurred.
If these conditions are met, the character will be able to move diagonally.
In your code, this needs to be further redone.
There is one problem here... I check the pressing keys in the programs and disable the pressing flags... how will this happen in this case?
if keyDown = Left then
flag Left := true
else
flagLeft := false;
can it be in a similar variant?