You are not logged in.
Pages: 1
I have been working on a batch game for about a day.... And now I have a question. Is there a way to put a symbol/letter underneath your player?
This is my code for moving:
:main_loop
call :display
call :move
goto main_loop
:display
graphic.exe locate 0 0
echo.
set /a xAdd1=pos_x+1
for /l %%u in (0,1,9) do (
set line=!line[%%u]!
if %%u == %pos_y% (
set line=!line:~0,%pos_x%!@!line:~%xAdd1%!
set tileover1=%pos_x%
set tileover2=%pos_y%
)
set checkingline[%%u]=!line!
echo !line!
)
goto :eof
:move
set prav_x=!pos_x!
set prav_y=!pos_y!
Kbd.exe
set label=%errorlevel%
set errorlevel=
goto label
if %errorlevel% equ 1 goto move
:label
if %errorlevel% == 72 goto 72
if %errorlevel% == 75 goto 75
if %errorlevel% == 80 goto 80
if %errorlevel% == 77 goto 77
if %errorlevel% == 113 goto 113
goto main_loop
:72
set /a pos_y-=1
goto check4wall
:75
set /a pos_x-=1
goto check4wall
:80
set /a pos_y+=1
goto check4wall
:77
set /a pos_x+=1
goto check4wall
:113
set pos_y=%prav_y%
goto check4wall
:check4wall
set /a chars=%pos_x%+1
set lineToCheck=!checkingline[%pos_y%]:~0,%chars%!
set moveToTile=!lineToCheck:~-1!
if !moveToTile! == Û (
set pos_x=!prav_x!
set pos_y=!prav_y!
)
goto :eof
If someone would please help... That would be fantastic... Thanks,
Andrew
Offline
Your exe files aren't native windows files are they?
Offline
Pages: 1