Oyunlar, Komut İstemi'nde çalışacak şekilde oluşturulabilir mi?CMD'de bir oyun oluşturmak mümkün mü?
0
A
cevap
2
Sen "toplu" dosya veya " .bat " ilginizi çekebilir. Bunlar Not Defteri'nde oluşturulabilir. Komut İstemi'nde kalmak istemiyorsanız, "kopyala C: \ yerde \ anyname.bat" komutunu deneyebilirsiniz ve ne zaman yazdığınıza, CTRL + Z tuşuna bastıktan sonra bu dosyaya kaydedilir.
Yani teoride
....ilk dosyası oluşturun. copy con C: \ movegame.bat Aşağıdaki kodu girin.
@setlocal enableextensions enabledelayedexpansion
@echo off
title movement
color 0a
set length=
set height= a
:controls
cls
echo Use WASD to move your character ([]).
echo.
for %%a in (%height%) do echo.
echo %length%[]
choice /c wasd /n
if %errorlevel% equ 1 call:up
if %errorlevel% equ 2 call:left
if %errorlevel% equ 3 call:down
if %errorlevel% equ 4 call:right
:left
set length=!length:~0,-1!
goto controls
:right
set length=%length%
goto controls
:up
set height=!height:~0,-2!
goto controls
:down
set height=%height% a
goto control
CTRL + Z (Bu kazandıracak dosyası)
Sonra toplu dosyasını çalıştırabilirsiniz. Taşınmak için WASD. C: \ movegame.bat
Çok yapılabilir daha, bu sadece 29 satır. Yukarıdaki toplu iş dosyasıyla ilgili aşağıdaki makaleye göz atın.
Batch Game Movement (Tutorial)
Eğer fikirler veya ilham arıyorsanız, Zork deneyin. Bütün metin tabanlı macera. QBasic veya Basic de sizi ilgilendirebilir.
[kesinlikle mümkün] (http://www.dostips.com/forum/viewtopic.php?t=4741) - elbette metin tabanlı oyunlar. – Stephan