Real time keyboard inputs in batch -
this link https://www.youtube.com/watch?v=eule3dns8dm shows game made in batch. game, called viewpoint, allows move around , shoot @ enemies. game seems accept keyboard input in real time perform actions. there way can batch file accept keyboard input in real time well?
(guessing "core" folder saw in game folder, there might other program or command involved.)
you use choice command (which snake.bat uses) can take alpha-numeric input 1 @ time.
here quick program whipped uses choice take wasd input.
@setlocal enableextensions enabledelayedexpansion @echo off prompt $$$g title movement color 0a set length= %%a in (1 2 3) ( set "length=!length! " ) :controls cls echo use wasd move character ([]). 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 length=!length:~0,-80! goto controls :down set "length= %length%" goto controls the main thing should focus on :controls label , how uses choice command read input.
Comments
Post a Comment