How to Make Batch File Animations!
Intro: How to Make Batch File Animations!
In this instructable I am going to show you how to make simple batch file animations.
Similar to "The Star Wars" batch.
So lets Get Started!
Similar to "The Star Wars" batch.
So lets Get Started!
STEP 1: The Bouncing Ball
The Bouncing Ball!
After seeing the "Batch Star Wars" I decided to make The Bouncing Ball a simple batch that I coded in my free time (during school study halls).
This was my first attempt at an animation in batch.
After about a 5 days of trial and error. I got it working.
So now im going to show you how to make one yourself.
After seeing the "Batch Star Wars" I decided to make The Bouncing Ball a simple batch that I coded in my free time (during school study halls).
This was my first attempt at an animation in batch.
After about a 5 days of trial and error. I got it working.
So now im going to show you how to make one yourself.
STEP 2: The Bouncing Ball Code and Explanation
Of Course you need some code to make this animation.
Just like a camera having frames or "pictures" to make a video batch Can be used the same way.
So we need to make a bunch of "pictures" for the batch file to display in an timed order.
Here is some example code of a bouncing ball....
echo -------------------
echo *
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo -------------------
ping localhost -n 1 >nul
cls
echo -------------------
echo.
echo *
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo -------------------
ping localhost -n 1 >nul
cls
The * is the ball. After every frame the ball moves one space down.
After Every "Frame" we use cls to clear the screen so its ready for the next "frame".
And ping localhost -n 1 >nul is a code used to pause the code just for a fraction of a second.
You can download my full bouncing ball Batch below.
Just like a camera having frames or "pictures" to make a video batch Can be used the same way.
So we need to make a bunch of "pictures" for the batch file to display in an timed order.
Here is some example code of a bouncing ball....
echo -------------------
echo *
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo -------------------
ping localhost -n 1 >nul
cls
echo -------------------
echo.
echo *
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo -------------------
ping localhost -n 1 >nul
cls
The * is the ball. After every frame the ball moves one space down.
After Every "Frame" we use cls to clear the screen so its ready for the next "frame".
And ping localhost -n 1 >nul is a code used to pause the code just for a fraction of a second.
You can download my full bouncing ball Batch below.
STEP 3: Party Time Batch!
Ah Yes The Party Time Batch!
Once again the "Party Time Batch" was a Batch I coded in my free time.
This batch is Still Suitable to be an "Animation". This is one of the most Fun batches I ever created.
This is Similar to the Bouncing Ball that they both have "Frames" but this one changes color.
Here is a Code Sample But Download the full batch.
:top
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo *********
echo *** ***
echo *** *** ******
echo ********* ****** **
echo *** *** ** * ** ** **
echo *** ** ** ****** ** ** **
echo *** ******* ** ** ** **
echo *** ** ** ** ** ** **
echo *** ** ** ** ** ** **
echo.
color 1a
ping localhost -n 0 >nul
color 2b
ping localhost -n 0 >nul
color 3c
ping localhost -n 0 >nul
color 4d
ping localhost -n 0 >nul
color 5e
ping localhost -n 0 >nul
color 6f
ping localhost -n 0 >nul
color 7a
ping localhost -n 0 >nul
color 8b
ping localhost -n 0 >nul
color 9c
ping localhost -n 0 >nul
goto time
Once again the "Party Time Batch" was a Batch I coded in my free time.
This batch is Still Suitable to be an "Animation". This is one of the most Fun batches I ever created.
This is Similar to the Bouncing Ball that they both have "Frames" but this one changes color.
Here is a Code Sample But Download the full batch.
:top
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo *********
echo *** ***
echo *** *** ******
echo ********* ****** **
echo *** *** ** * ** ** **
echo *** ** ** ****** ** ** **
echo *** ******* ** ** ** **
echo *** ** ** ** ** ** **
echo *** ** ** ** ** ** **
echo.
color 1a
ping localhost -n 0 >nul
color 2b
ping localhost -n 0 >nul
color 3c
ping localhost -n 0 >nul
color 4d
ping localhost -n 0 >nul
color 5e
ping localhost -n 0 >nul
color 6f
ping localhost -n 0 >nul
color 7a
ping localhost -n 0 >nul
color 8b
ping localhost -n 0 >nul
color 9c
ping localhost -n 0 >nul
goto time
STEP 4: Post Your Creations!
Have Fun with this information.
If You Could Post Your Animations I would love to see how they came out.
Below Are the 2 Files Again.
If You Could Post Your Animations I would love to see how they came out.
Below Are the 2 Files Again.
STEP 5: Upcoming.......
Right Now Im working on a Batch Pong!!!
Batch Pong Copyright 2009 I Got a Cup Productions.
Batch Pong Copyright 2009 I Got a Cup Productions.
31 Comments
princezezgem 2 years ago
dragonslayer212 8 years ago
My movie wont work.Can you fix it?Here's the code:
@echo off
:a
echo.
echo 0
echo l
cls
ping localhost -n 2 >nul
echo.
echo 0
echo l
cls
ping localhost -n 2 >nul
echo 0
echo l
cls
ping localhost -n 2 >nul
echo 0
echo l
cls
ping localhost -n 2 >nul
cls
goto a
ThijmenH 5 years ago
@echo off
:a
echo.
echo 0
echo l
ping localhost -n 2 >nul
cls
echo.
echo 1
echo 0
ping localhost -n 2 >nul
cls
goto a
kinglarry II 5 years ago
u should do set /p input=
Sembot 6 years ago
how can i adjust the speed of moving , en make sound
DylanH11 8 years ago
Bad Coding. Here is good coding (bounces foreverrrr)
@ECHO off
set ip=google.com
set /A ms=50
set direction=0
set /A p=0+1
goto main
:DOWN
CLS
ECHO ______________________
FOR /L %%G IN (1,1,10) DO (
if "%%G" EQU "%p%" (
ECHO ^| O ^|
set /A p=%p%+1
if "%p%" EQU "10" (
set direction=1
)
) else (
ECHO ^| ^|
)
)
ECHO ``````````````````````
ping %ip% -n 1 -w %ms% >nul
if "%p%" NEQ "11" goto DOWN
set /A p=0+9
goto main
:UP
CLS
::ECHO %direction%, %p%
ECHO ______________________
FOR /L %%G IN (1,1,10) DO (
if "%%G" EQU "%p%" (
ECHO ^| o ^|
set /A p=%p%-1
if "%p%" EQU "1" (
set direction=0
)
) else (
ECHO ^| ^|
)
)
ECHO ``````````````````````
ping %ip% -n 1 -w %ms% >nul
if "%p%" NEQ "0" goto UP
set /A p=0+2
goto main
:main
if "%direction%" EQU "0" goto DOWN
if "%direction%" EQU "1" goto UP
PaperAirplanz 7 years ago
works! thanks!
DylanH11 8 years ago
So looks like my spacing didn't come out right. You can probably figure it out tho
CodeSmartz 8 years ago
Thank you for this tutorial because all i needed to remember was the ping localhost command!
isurumy 8 years ago
Try this development environment for batch scripts, Batch Compiler ( http://bc.gotek.info ). It has everything you need to develop a batch program.And compile into stable stand alone executable (Exe).
Specially Drawing Graphics in too easy with Batch Compiler.
Friendly user interface.
Debugger, Check your code for syntax errors.
Powerful, versatile compiler.
Allows mouse input in batch files.
Use Windows Common Dialog Boxes.(BrowseFiles,BrowseFolders)
Draw graphics in batch files.
Reverse engineering proof encryption of source code.
Include Company name, Copyright info and Version info.
Make invisible(silent) executables.
Executables with administrator privileges.
Run & debug your script while editing.
Embed resources with executable.(music,images,files)
Advance Commands (BrowseFiles,LaunchSilent,MouseCMD)
Stand-alone executables.No dependencies needed.
Executables are woking on almost all windows operating systems.(98 to 10)
Home : http://bc.gotek.info
Quick download : http://bc.gotek.info/files/BatchCompiler1600.zip
Hope this helps you.
RedFlash 13 years ago
fabsy333 11 years ago
GreysenE 8 years ago
http://bfy.tw/vTY
bendee 12 years ago
HarshalK1 8 years ago
vincents2 9 years ago
The bouncing ball is quite stupid...
I mean, couldn't the creator just loop it so that the creator didn't have to copy-paste it so much?
abdullah.sh.18 9 years ago
there r some change :)
yasar.shaikh.5623 9 years ago
add "@echo off" as first line.
@echo off
:top
cls
echo.
echo.
echo.
echo.
echo.
etc etc......
This will work :)
ncortiz 11 years ago
bjohn29 14 years ago