Re: One more try
From Ool <ulr...@t-online.de>
· alt.ascii-art.animation
· 15 Oct 2000 04:25 · View full thread
· report
"KuSiFa" <kur...@uni.de> wrote in message news:8sa12i$n5e$1...@wrath.news.nacamar.de...
JavaScript Animated Traffic
Here's a JavaScript animation that doesn't use fixed frames. Instead, it adds random traffic out of a list of 13 cars, trucks and bikes. The cars were made by Marijn Kampf, who has also animated them at:
http://www.gwobbel.club.tip.nl/anim.html
Bit bumper to bumper, aren't they? I've modified the code so the least tailgating distance is at least two characters, or more, each at the probability of 95%.
Bißchen Stoßstange an Stoßstange, nicht wahr? Ich habe den Code modifiziert, so daß der geringste Auffahrabstand mindestens zwei Zeichen lang ist, oder mehr, je mit der Wahrscheinlichkeit von 95%.
--
__ "Space Opera! It's not over __
('__`> until the Fat Lady explodes." <'__`)
//6(6; ©OOL mm :^)^\\
`\_-/ http://home.t-online.de/home/ulrich.schreglmann/00L.htm \-_/"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"KuSiFa" <<A href="mailto:kur...@uni.de">kur...@uni.de</A>> wrote
in message <A
href="news:8sa12i$n5e$1...@wrath.news.nacamar.de">news:8sa12i$n5e$1...@wrath.news.nacamar.de</A>...</DIV>
<H1>JavaScript Animated Traffic</H1>
<DIV>Here's a JavaScript animation that doesn't use fixed frames. Instead, it
adds random traffic out of a list of 13 cars, trucks and bikes. The cars were
made by Marijn Kampf, who has also animated them at:</DIV>
<DIV> </DIV>
<DIV><A
href="http://www.gwobbel.club.tip.nl/anim.html">http://www.gwobbel.club.tip.nl/anim.html</A></DIV></BLOCKQUOTE>
<DIV><STRONG><FONT face="Courier New" size=2></FONT></STRONG>
<DIV>Bit bumper to bumper, aren't they? I've modified the code so the
least tailgating distance is at least two characters, or more, each at the
probability of 95%.</DIV>
<DIV> </DIV>
<DIV><STRONG><FONT face="Courier New" size=2></FONT></STRONG>
<DIV>Bißchen Stoßstange an Stoßstange, nicht wahr? Ich habe den Code
modifiziert, so daß der geringste Auffahrabstand mindestens zwei Zeichen lang
ist, oder mehr, je mit der Wahrscheinlichkeit von 95%.</DIV>
<FORM name=f><TEXTAREA name=t rows=8 cols=70></TEXTAREA> </FORM>
<SCRIPT language=JavaScript>
<!--
function MakeArray() {
for (i=0;i<MakeArray.arguments.length;i++) this[i]=MakeArray.arguments[i];
}
// make the first frame: (the reason it looks distorted is because all \'s
// have been replaced by \\'s)
carwidth = 0;
numcars = 13;
carheight = 7;
framewidth = 70;
cars = new Array(numcars); // all the cars
frame = new MakeArray(
" ",
" ",
" ",
" ",
" ",
"----------------------------------------------------------------------",
" ");
// begin added by ool
gapprob = .95;
tailgatefloor = 2;
gap = new MakeArray(
" ",
" ",
" ",
" ",
" ",
"-",
" ");
// end added by ool
cars[0] = new MakeArray(
" ",
" ",
" .-O ",
" ==-( <-`7) ",
" ,/.//__/\\.",
"--`-'----`-'",
" ");
cars[1] = new MakeArray(
" ",
" ",
" ___ ",
" _/[]L\\__ ",
" (_,.__,._)",
"---`'--`'--",
" ");
cars[2] = new MakeArray(
" ",
" ",
" __ ",
" _____|L\\___ ",
" (_,._____,._)",
"---`'-----`'--",
" ");
cars[3] = new MakeArray(
" ",
" ",
" ",
" __~p\\___ ",
" (_,.__,._)",
"---`'--`'--",
" ");
cars[4] = new MakeArray(
" ",
" ",
" ____ ",
" /_/CL\\___ ",
" \\_,.__,._)",
"---`'--`'--",
" ");
cars[5] = new MakeArray(
" ",
" ",
" ____ ",
" |_| L\\___ ",
" |_,.__,._)",
"---`'--`'--",
" ");
cars[6] = new MakeArray(
" ",
" ",
" _______ ",
" /____/CL\\___ ",
" |_,._____,._)",
"---`'-----`'--",
" ");
cars[7] = new MakeArray(
" ",
" ",
" ________ ",
" |[][][] L\\ ",
" |_,.___,._)",
"---`'---`'--",
" ");
cars[8] = new MakeArray(
" ",
" ",
" _________ ",
" |______/ L\\",
" |_,.___,._|",
"---`'---`'--",
" ");
cars[9] = new MakeArray(
" ",
" ",
" ______ ___ ",
" /[] []\\ _/[]L\\__ ",
" \\__,.__|-(_,.__,._)",
"----`'------`'--`'--",
" ");
cars[10] = new MakeArray(
" ___________________ ________________________ ",
" | | | || -.\\ ",
" | OOLCO | | OOLCO Inc. || |_\\\\",
" |___________________| |___________________|| - |",
" B_,-.___________,-._|-B_,-._,-.____________|,-._)",
"---`-'-----------`-'-----`-'-`-'-------------`-'--",
" ");
cars[11] = new MakeArray(
" ________________________________ H___ ",
" P MK'98| H ..\\ ",
" | OOLCO Inc. _______| H |_\\\\",
" | |.========H - |",
" B_,-._,-._______________/ |,-._,-._H_,-.)",
"---`-'-`-'------------------`-'-`-'---`-'-",
" ");
cars[12] = new MakeArray(
" ________________________________ H___ ",
" | __ __ _ __ MK'98||H ..\\ ",
" | //\\\\ //\\\\ || //` //\\\\ _______||H |_\\\\___ ",
" | \\\\// \\\\// ||_ \\\\, \\\\// |.======='H - |",
" B_,-._,-._______________/ |,-._,-._H____,-._)",
"---`-'-`-'------------------`-'-`-'------`-'--",
" ");
function addCar() {
x = Math.floor(Math.random() * numcars);
// begin added by ool
for (gaplength = tailgatefloor; Math.random() < gapprob; ++gaplength) {}
// end added by ool
for (y=0;y<carheight;y++) {
// begin added by ool
for (gapspace = 0; gapspace < gaplength; ++gapspace) {
frame[y]=gap[y]+frame[y];
}
// end added by ool
frame[y]=cars[x][y]+frame[y];
}
// begin deleted by ool
// carwidth+=cars[x][0].length;
// end deleted by ool
// begin added by ool
carwidth = carwidth + gaplength + cars[x][0].length;
// end added by ool
}
function animate() {
var str="";
if (carwidth<=2) addCar();
carwidth-=2;
for (x=0;x<carheight;x++) {
str+=frame[x].substring(carwidth,framewidth+carwidth)+"\r\n";
frame[x]=frame[x].substring(0,framewidth+carwidth);
}
document.f.t.value=str;
setTimeout("animate()",60);
}
animate();
// -->
</SCRIPT>
<DIV><STRONG><FONT face="Courier New" size=2></FONT></STRONG> </DIV><BR>--
<BR> __ "Space Opera! It's not
over
__<BR>('__`>
until the Fat Lady explodes." <'__`)<BR>//6(6; ©OOL
mm
:^)^\\<BR>`\_-/ <A
href="http://home.t-online.de/home/ulrich.schreglmann/00L.htm">http://home.t-online.de/home/ulrich.schreglmann/00L.htm</A>
\-_/"<BR></DIV></DIV></BODY></HTML>
Original message headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f7c81,82abe7e2da3d229f,start X-Google-Attributes: gidf7c81,public X-Google-Thread: fd588,82abe7e2da3d229f,start X-Google-Attributes: gidfd588,public X-Google-ArrivalTime: 2000-10-14 21:26:03 PST Path: supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeed.online.be!newsfeed01.sul.t-online.de!newsmm00.btx.dtag.de!t-online.de!news.t-online.com!not-for-mail From: "Ool" <ulr...@t-online.de> Newsgroups: de.alt.rec.ascii-art,alt.ascii-art.animation Subject: Re: One more try Date: Sun, 15 Oct 2000 06:25:29 +0200 Organization: T-Online Lines: 313 Message-ID: <8sbbg1$ktq$04$1...@news.t-online.com> References: <8sa12i$n5e$1...@wrath.news.nacamar.de> Reply-To: "Ool" <ulr...@t-online.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0070_01C03670.B6C86F80" X-Trace: news.t-online.com 971583811 04 21434 3Y+XMOVSlAB4V 001015 04:23:31 X-Complaints-To: abu...@t-online.com X-Sender: 320...@t-dialin.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: supernews.google.com alt.ascii-art.animation:92
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
.="=. _/.-.-.\_ ( ( o o ) ) |/ " \| \'---'/jgs /`"""`\\
_________ | _____ |\ | |\ ___| | \ | | | | | | | | |___| | | \ | |____\| | \|_________| Andy Johnson
__ _ o'')}____// `_/ ) (_(_/-(_/
[>====]
)) .-#-----. /_________\ |[] _ []| | |*| |
, , , , , <(__)> | | | | \/ | \_|_/ \^ ^/ | /\--/\ /| / \/ \/jgs
Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this message.
This message was posted publicly to the newsgroup
alt.ascii-art.animation
in 2000 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.
Report this message
Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.