IcarusLives

Car

Nov 21st, 2020
827
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off & setlocal enableDelayedExpansion
  2.  
  3. timeout /t 7
  4. call :macros
  5.  
  6. set /a "hei=60","wid=100"
  7.  
  8. rem spriteInformation
  9. set "body=%esc%[38;5;11mÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[27D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[0m"
  10. set "top=%esc%[38;5;11mÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[14D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛ          ÛÛ%esc%[14D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[14D%esc%[BÛÛÛÛÛÛÛÛÛÛÛÛÛÛ%esc%[0m"
  11.  
  12. set /a  "wheelSize=4", "carY=hei / 2"
  13.  
  14. mode %wid%,%hei%
  15. :main
  16.  
  17.     for /l %%# in () do (
  18.    
  19.    
  20.         set /a  "carX+=1", "angle1+=3", "angle2=angle1 + 90", "angle3=angle2 + 90", "angle4=angle3 + 90", "topM=carX + 6",^
  21.                 "leftWheelPosition=carX + 5",^
  22.                 "rightWheelPosition=leftWheelPosition + wheelSize * 3 + 4"
  23.        
  24.         for /l %%a in (1,1,4) do (
  25.             set /a "spx%%a=wheelSize * !cos:x=angle%%a! + leftWheelPosition", "spy%%a=wheelSize * !sin:x=angle%%a! + carY"
  26.         )
  27.         %line% spx1 spy1 spx3 spy3 15
  28.         set "screen=!screen!!$line!"
  29.         %line% spx2 spy2 spx4 spy4 15
  30.         set "screen=!screen!!$line!"
  31.        
  32.         for /l %%a in (1,1,4) do (
  33.             set /a "spx%%a=wheelSize * !cos:x=angle%%a! + rightWheelPosition", "spy%%a=wheelSize * !sin:x=angle%%a! + carY"
  34.         )
  35.         %line% spx1 spy1 spx3 spy3 15
  36.         set "screen=!screen!!$line!"
  37.         %line% spx2 spy2 spx4 spy4 15
  38.         set "screen=!screen!!$line!"
  39.    
  40.         set "leftWheel=" & set "rightWheel="
  41.         for /l %%a in (1,3,360) do (
  42.             set /a  "lcx=wheelSize * !cos:x=%%a! + leftWheelPosition",^
  43.                     "lcy=wheelSize * !sin:x=%%a! + carY",^
  44.                     "rcx=wheelSize * !cos:x=%%a! + rightWheelPosition",^
  45.                     "rcy=wheelSize * !sin:x=%%a! + carY"
  46.                    
  47.             set "leftWheel=!leftWheel!%esc%[!lcy!;!lcx!HÛ"
  48.             set "rightWheel=!rightWheel!%esc%[!rcy!;!rcx!HÛ"
  49.         )
  50.        
  51.         set "screen=!screen!%esc%[8;!topM!H!top!%esc%[18;!carX!H%body%!leftWheel!!rightWheel!%esc%[0m"
  52.  
  53.         <nul set /p "=%esc%[2J!screen!!screen2!" & set "screen="
  54.        
  55.         if !carX! equ 67 pause & exit
  56.     )
  57. exit
  58.  
  59.  
  60. :macros
  61. (set \n=^^^
  62. %= This creates an escaped Line Feed - DO NOT ALTER =%
  63. )
  64. ( for /f %%a in ('echo prompt $E^| cmd') do set "esc=%%a" ) & <nul set /p "=!esc![Û25l"
  65.  
  66. REM Û
  67. set "_SIN=a-a*a/1920*a/312500+a*a/1920*a/15625*a/15625*a/2560000-a*a/1875*a/15360*a/15625*a/15625*a/16000*a/44800000"
  68. set "sin=(a=(x * 31416 / 180)%%62832, c=(a>>31|1)*a, a-=(((c-47125)>>31)+1)*((a>>31|1)*62832)  +  (-((c-47125)>>31))*( (((c-15709)>>31)+1)*(-(a>>31|1)*31416+2*a)  ), %_SIN%) / 10000"
  69. set "cos=(a=(15708 - x * 31416 / 180)%%62832, c=(a>>31|1)*a, a-=(((c-47125)>>31)+1)*((a>>31|1)*62832)  +  (-((c-47125)>>31))*( (((c-15709)>>31)+1)*(-(a>>31|1)*31416+2*a)  ), %_SIN%) / 10000"
  70.  
  71.  
  72. rem line x0 y0 x1 y1 color
  73. set line=for %%# in (1 2) do if %%#==2 ( for /f "tokens=1-5" %%1 in ("^!args^!") do (%\n%
  74.     if "%%~5" equ "" ( set "hue=30" ) else ( set "hue=%%~5")%\n%
  75.     set "$line=%esc%[38;5;^!hue^!m"%\n%
  76.     set /a "xa=%%~1", "ya=%%~2", "xb=%%~3", "yb=%%~4", "dx=%%~3 - %%~1", "dy=%%~4 - %%~2"%\n%
  77.     if ^^!dy^^! lss 0 ( set /a "dy=-dy", "stepy=-1" ) else ( set "stepy=1" )%\n%
  78.     if ^^!dx^^! lss 0 ( set /a "dx=-dx", "stepx=-1" ) else ( set "stepx=1" )%\n%
  79.     set /a "dx<<=1", "dy<<=1"%\n%
  80.     if ^^!dx^^! gtr ^^!dy^^! (%\n%
  81.         set /a "fraction=dy - (dx >> 1)"%\n%
  82.         for /l %%x in (^^!xa^^!,^^!stepx^^!,^^!xb^^!) do (%\n%
  83.             if ^^!fraction^^! geq 0 set /a "ya+=stepy", "fraction-=dx"%\n%
  84.             set /a "fraction+=dy"%\n%
  85.             set "$line=^!$line^!%esc%[^!ya^!;%%xHÛ"%\n%
  86.         )%\n%
  87.     ) else (%\n%
  88.         set /a "fraction=dx - (dy >> 1)"%\n%
  89.         for /l %%y in (^^!ya^^!,^^!stepy^^!,^^!yb^^!) do (%\n%
  90.             if ^^!fraction^^! geq 0 set /a "xa+=stepx", "fraction-=dy"%\n%
  91.             set /a "fraction+=dx"%\n%
  92.             set "$line=^!$line^!%esc%[%%y;^!xa^!HÛ"%\n%
  93.         )%\n%
  94.     )%\n%
  95.     set "_$_=^!_$_^!^!$line^!"%\n%
  96. )) else set args=
RAW Paste Data