Solved how do i make a basic movement code in batch

July 16, 2016 at 10:56:18
Specs: Windows 8.1
I want to make a game that you can move around in and I want the code to be short and easy
Also I want to know the meanings to the lines codes
/(-I'm using NotePad-)\

message edited by eliteviper


See More: how do i make a basic movement code in batch

Report •


#1
July 16, 2016 at 13:12:52

Report •

#2
July 17, 2016 at 19:46:30
✔ Best Answer
"I want to make a game that you can move around in and I want the code to be short and easy "
not gonna happen using batch. Even higher languages, which I recommend, won't make it real simple. The gist is this: your batch builds a space which consists of multiple horizontal "raster-lines". Each raster-line is in turn composed of spaces, characters and obstacles ("walls").. Each time any character moves, (or anything else happens, such as a "door" opening or something blowing up), the raster-lines (usually three or less raster-lines involved) are updated with the new data. Then the screen is cleared and the entire set of raster-lines is re-displayed. Here's a VERY simple example moving an object across the screen:
@echo off & setlocal enabledelayedexpansion
set x= @
for /l %%a in (1 1 80) do (
set x=!x:~0,-1! @
cls
echo !x!
rem display-speed delay
call :t2 5
)
goto :eof

:t2
rem timer: NOT milliseconds - hundredths resolution: 100=1 second
set d=%1
set prev=%time%
set c=0
:1
if %time% equ %prev% goto :1
set /a c+=1
if %c% geq %d% goto :eof
set prev=%time%
goto :1
::======== end batch snippet
Here's what you're up against using batch:
http://www.computing.net/answers/pr...
I got my game to work ok, but I don't think the poster ever did.

message edited by nbrane


Report •

Related Solutions


Ask Question