Animation in Batch.

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Animation in Batch.

Post by beagle on Fri Aug 08, 2008 12:09 pm
([msg=9109]see Animation in Batch.[/msg])

I keep trying to make a game in batch code that has basic animation in it. but every time I give it a test run, it doesnt work. The command prompt just flashes in front of me really fast.
The goal of the game is to get out of a maze. Here's is the code, someone please tell me what I'm doing wrong.
This is what I have so far (Remember, the game is not finished yet):
Code: Select all
@echo off
:start
color 0a
echo      |----------------------------------------|
echo      |--------|                  |       |    |
echo      |        |                  |       |    |
echo      |   :)   |                          |   |
echo      |        |                  |       |    |
echo      |        |                  -----|       |
echo      |        | ---------|         |          |
echo      |        |         |          |     |    |
echo      |        |         |          |     |    |
echo      |                ---| -----------|  | *  |
echo      |                                   |    |
echo      ------------------------------------------
:key
color 47
echo ***************************************
echo                COMMANDS
echo North-n
echo East-e
echo South-s
echo West-w
echo ********************************************
color 0a
set /p a=
if %a%==n  goto 1n
if %a%==e  goto 1e
if %a%==s  goto 1s
if %a%==w  goto 1w


EDITED: topic title typo by faith.
011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)


Re: Animation is Batch.

Post by L0DER on Sat Aug 09, 2008 7:09 am
([msg=9167]see Re: Animation is Batch.[/msg])

Its very simple you just had to look for some information source.
The '|' it an operator you cannot use it like that, at least you can use '*' . (for lazy people)http://www.wisecode.net63.net/dev/game.bat
Code: Select all
@echo off
:start
color 0a
echo      *----------------------------------------*
echo      *--------*                  *       *    *
echo      *        *                  *       *    *
echo      *        *                          *    *
echo      *        *                  *       *    *
echo      *        *                  -----*       *
echo      *        * ---------*         *          *
echo      *        *         *          *     *    *
echo      *        *         *          *     *    *
echo      *                ---* -----------*  * *  *
echo      *                                   *    *
echo      ------------------------------------------
:key
color 47
echo ***************************************
echo                COMMANDS
echo North-n
echo East-e
echo South-s
echo West-w
echo ***************************************
color 0a
set /p a=
if %a%==n  goto 1n
if %a%==e  goto 1e
if %a%==s  goto 1s
if %a%==w  goto 1w



But if you want '|' then you should find a way to output an Hexadecimal(hex) or Decimal(dex) then output 7C(HEX) or 124(dex). check out some ANSI table, try alt+254. Or you can put together from these chars. http://www.atlantiswordprocessor.com/en/news/1_6_1_001_00.png
http://www.allbusiness.com/asset/image/glossaries/4967329.gif

//simple thing like that you can make in simple c++ or some other language and it would be a lot easier
*exe version with '|'*http://www.wisecode.net63.net/dev/bgame.exe
Also you should do loading map function if you want to make better game.
*bgame.exe*
Image
L0DER
New User
New User
 
Posts: 26
Joined: Tue Apr 22, 2008 12:58 am
Blog: View Blog (0)


Re: Animation is Batch.

Post by beagle on Sat Aug 09, 2008 11:14 am
([msg=9175]see Re: Animation is Batch.[/msg])

Wow.That was a ton of really useful information. Thank you so much! I am eternally grateful.
I'll post the code here when the game is done.
Thank you so much again!
011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)


Re: Animation is Batch.

Post by L0DER on Sat Aug 09, 2008 11:49 am
([msg=9177]see Re: Animation is Batch.[/msg])

I'm happy I could help you. :)
L0DER
New User
New User
 
Posts: 26
Joined: Tue Apr 22, 2008 12:58 am
Blog: View Blog (0)


Re: Animation is Batch.

Post by beagle on Sat Aug 09, 2008 11:52 am
([msg=9181]see Re: Animation is Batch.[/msg])

Happy to be helped. ;)
011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests