Advertisement
Guest User

Flappy Bird in Batch

a guest
Feb 19th, 2017
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 17.51 KB | None | 0 0
  1. @echo off
  2. title Flappy Bird
  3. if %run% neq true exit
  4. mode con: cols=21 lines=11
  5.  
  6. echo [%date% %time%] Game Launched >> logs.txt
  7.  
  8. ::===========================================================================
  9. ::MENU
  10. ::===========================================================================
  11. ::-MENU
  12. :menu
  13. set newHigh=0
  14. cd %pjpath%
  15. cls
  16. echo -----FLAPPY BIRD-----
  17. echo 1. Play
  18. echo 2. Reset Scores
  19. echo 3. Exit
  20. echo.
  21. echo Highscore: %highscore%
  22. echo ---------------------
  23. set /p c=
  24. if %c% equ 3 exit
  25. if %c% equ 2 goto resetScores
  26. if %c% equ 1 goto play
  27.  
  28. :resetScores
  29. echo.
  30. echo Are you sure you want to Reset your Scores? [Y/N]
  31. set /p c=
  32. if %c% neq Y goto menu
  33. cd data
  34. del /f /q save.sav
  35. type nul > save.tmp
  36. echo set highscore=0 > save.tmp
  37. certutil -encode save.tmp save.sav
  38. del /f /q save.tmp
  39. cls
  40. echo Scores reseted!
  41. echo Press Enter to Reboot
  42. pause>nul
  43. cd %pjpath%
  44. echo [%date% %time%] Reseted Score >> logs.txt
  45. start game.exe
  46. exit
  47.  
  48. ::===========================================================================
  49. ::PLAY
  50. ::===========================================================================
  51. :play
  52. echo [%date% %time%] Started a game >> logs.txt
  53. ::-PREPARE
  54. cls
  55. ::===========================================================================
  56. ::SETUP COORDINATES
  57. ::===========================================================================
  58. set a1=O
  59. set a2=O
  60. set a3=O
  61. set a4=O
  62. set a5=O
  63. set a6=O
  64. set a7=O
  65. set a8=O
  66. set a9=O
  67. set a10=O
  68. set a11=O
  69. set a12=O
  70. set a13=O
  71. set a14=O
  72. set a15=O
  73. set a16=O
  74. set a17=O
  75. set a18=O
  76. set a19=O
  77. set a20=O
  78. set a21=O
  79.  
  80. set b1=O
  81. set b2=O
  82. set b3=O
  83. set b4=O
  84. set b5=O
  85. set b6=O
  86. set b7=O
  87. set b8=O
  88. set b9=O
  89. set b10=O
  90. set b11=O
  91. set b12=O
  92. set b13=O
  93. set b14=O
  94. set b15=O
  95. set b16=O
  96. set b17=O
  97. set b18=O
  98. set b19=O
  99. set b20=O
  100. set b21=O
  101.  
  102. set c1=O
  103. set c2=O
  104. set c3=O
  105. set c4=O
  106. set c5=O
  107. set c6=O
  108. set c7=O
  109. set c8=O
  110. set c9=O
  111. set c10=O
  112. set c11=O
  113. set c12=O
  114. set c13=O
  115. set c14=O
  116. set c15=O
  117. set c16=O
  118. set c17=O
  119. set c18=O
  120. set c19=O
  121. set c20=O
  122. set c21=O
  123.  
  124. set d1=O
  125. set d2=O
  126. set d3=O
  127. set d4=O
  128. set d5=O
  129. set d6=O
  130. set d7=O
  131. set d8=O
  132. set d9=O
  133. set d10=O
  134. set d11=O
  135. set d12=O
  136. set d13=O
  137. set d14=O
  138. set d15=O
  139. set d16=O
  140. set d17=O
  141. set d18=O
  142. set d19=O
  143. set d20=O
  144. set d21=O
  145.  
  146. set e1=O
  147. set e2=O
  148. set e3=O
  149. set e4=O
  150. set e5=O
  151. set e6=O
  152. set e7=O
  153. set e8=O
  154. set e9=O
  155. set e10=O
  156. set e11=O
  157. set e12=O
  158. set e13=O
  159. set e14=O
  160. set e15=O
  161. set e16=O
  162. set e17=O
  163. set e18=O
  164. set e19=O
  165. set e20=O
  166. set e21=O
  167.  
  168. set f1=O
  169. set f2=O
  170. set f3=O
  171. set f4=O
  172. set f5=O
  173. set f6=O
  174. set f7=O
  175. set f8=O
  176. set f9=O
  177. set f10=O
  178. set f11=O
  179. set f12=O
  180. set f13=O
  181. set f14=O
  182. set f15=O
  183. set f16=O
  184. set f17=O
  185. set f18=O
  186. set f19=O
  187. set f20=O
  188. set f21=O
  189.  
  190. set g1=O
  191. set g2=O
  192. set g3=O
  193. set g4=O
  194. set g5=O
  195. set g6=O
  196. set g7=O
  197. set g8=O
  198. set g9=O
  199. set g10=O
  200. set g11=O
  201. set g12=O
  202. set g13=O
  203. set g14=O
  204. set g15=O
  205. set g16=O
  206. set g17=O
  207. set g18=O
  208. set g19=O
  209. set g20=O
  210. set g21=O
  211.  
  212. set a4=Û
  213. set flappyCurrent=1
  214. set score=0
  215. set pipe=0
  216. set pipeRow=20
  217. set pipe2Row=20
  218. set alive=false
  219. set launchPipe2=0
  220. set Pipe2Active=false
  221.  
  222. echo [%date% %time%] Game Setup complete >> logs.txt
  223. echo RUNNING > gamestate
  224. cls
  225. echo Starting in 3 Seconds...
  226. echo [%date% %time%] Launched Keyboard.exe >> logs.txt
  227. start Keyboard.exe
  228. ping localhost -n 3 > nul
  229.  
  230. ::===========================================================================
  231. ::GAME LOOP
  232. ::===========================================================================
  233. echo [%date% %time%] Began Game Loop >> logs.txt
  234. :GAME_LOOP
  235. ::-SCORING
  236. set /a score=%score%+1
  237. set /a launchPipe2=%launchPipe2%+1
  238. if %launchPipe2% equ 10 set Pipe2Active=true
  239.  
  240. ::-MAPPING
  241. ::===========================================================================
  242. ::CREATE/MOVE PIPES
  243. ::===========================================================================
  244. set /a pipe=%pipe%+1
  245. if %pipe% equ 2 goto makePipes
  246. goto movePipes
  247.  
  248. :makePipes
  249. set pipe=0
  250. goto movePipes
  251.  
  252. :createPipe
  253. set var=%random%
  254. if %var% leq 16000 goto Pipe1
  255. if %var% leq 33000 goto Pipe2
  256.  
  257. :Pipe1
  258. echo [%date% %time%] Created new Pipe(1) >> logs.txt
  259. set pipeRow=20
  260. set a20=Û
  261. set b20=Û
  262. set c20=O
  263. set d20=O
  264. set e20=Û
  265. set f20=Û
  266. set g20=Û
  267. goto movePipes
  268.  
  269. :Pipe2
  270. echo [%date% %time%] Created new Pipe(2) >> logs.txt
  271. set pipe2Row=20
  272. set a20=Û
  273. set b20=Û
  274. set c20=Û
  275. set d20=O
  276. set e20=O
  277. set f20=O
  278. set g20=Û
  279. goto movePipes
  280.  
  281. set a20=Û
  282. set b20=Û
  283. set c20=Û
  284. set d20=O
  285. set e20=O
  286. set f20=Û
  287. set g20=Û
  288.  
  289. :movePipes
  290. if %Pipe2Active% neq true goto MOVEpipe1
  291. ::PIPE2
  292. :MOVEpipe2
  293. echo [%date% %time%] Moved Pipe2 >> logs.txt
  294. if %pipe2Row% equ 20 goto pipe2To19
  295. if %pipe2Row% equ 19 goto pipe2To18
  296. if %pipe2Row% equ 18 goto pipe2To17
  297. if %pipe2Row% equ 17 goto pipe2To16
  298. if %pipe2Row% equ 16 goto pipe2To15
  299. if %pipe2Row% equ 15 goto pipe2To14
  300. if %pipe2Row% equ 14 goto pipe2To13
  301. if %pipe2Row% equ 13 goto pipe2To12
  302. if %pipe2Row% equ 12 goto pipe2To11
  303. if %pipe2Row% equ 11 goto pipe2To10
  304. if %pipe2Row% equ 10 goto pipe2To9
  305. if %pipe2Row% equ 9 goto pipe2To8
  306. if %pipe2Row% equ 8 goto pipe2To7
  307. if %pipe2Row% equ 7 goto pipe2To6
  308. if %pipe2Row% equ 6 goto pipe2To5
  309. if %pipe2Row% equ 5 goto pipe2To4
  310. if %pipe2Row% equ 4 goto pipe2To3
  311. if %pipe2Row% equ 3 goto pipe2To2
  312. if %pipe2Row% equ 2 goto pipe2To1
  313. if %pipe2Row% equ 1 goto pipe2To0
  314. if %pipe2Row% equ 0 goto pipe2To19
  315.  
  316. ::PIPE1
  317. :MOVEpipe1
  318. echo [%date% %time%] Moved Pipe1 >> logs.txt
  319. if %pipeRow% equ 20 goto pipeTo19
  320. if %pipeRow% equ 19 goto pipeTo18
  321. if %pipeRow% equ 18 goto pipeTo17
  322. if %pipeRow% equ 17 goto pipeTo16
  323. if %pipeRow% equ 16 goto pipeTo15
  324. if %pipeRow% equ 15 goto pipeTo14
  325. if %pipeRow% equ 14 goto pipeTo13
  326. if %pipeRow% equ 13 goto pipeTo12
  327. if %pipeRow% equ 12 goto pipeTo11
  328. if %pipeRow% equ 11 goto pipeTo10
  329. if %pipeRow% equ 10 goto pipeTo9
  330. if %pipeRow% equ 9 goto pipeTo8
  331. if %pipeRow% equ 8 goto pipeTo7
  332. if %pipeRow% equ 7 goto pipeTo6
  333. if %pipeRow% equ 6 goto pipeTo5
  334. if %pipeRow% equ 5 goto pipeTo4
  335. if %pipeRow% equ 4 goto pipeTo3
  336. if %pipeRow% equ 3 goto pipeTo2
  337. if %pipeRow% equ 2 goto pipeTo1
  338. if %pipeRow% equ 1 goto pipeTo0
  339. if %pipeRow% equ 0 goto pipeTo19
  340.  
  341. :pipe2To19
  342. set pipe2Row=19
  343. set a19=Û
  344. set b19=Û
  345. set c19=Û
  346. set d19=Û
  347. set e19=O
  348. set f19=O
  349. set g19=Û
  350.  
  351. set a20=O
  352. set b20=O
  353. set c20=O
  354. set d20=O
  355. set e20=O
  356. set f20=O
  357. set g20=O
  358. goto MOVEpipe1
  359. :pipe2To18
  360. set pipe2Row=18
  361. set a18=Û
  362. set b18=Û
  363. set c18=Û
  364. set d18=Û
  365. set e18=O
  366. set f18=O
  367. set g18=Û
  368.  
  369. set a19=O
  370. set b19=O
  371. set c19=O
  372. set d19=O
  373. set e19=O
  374. set f19=O
  375. set g19=O
  376. goto MOVEpipe1
  377. :pipe2To17
  378. set pipe2Row=17
  379. set a17=Û
  380. set b17=Û
  381. set c17=Û
  382. set d17=Û
  383. set e17=O
  384. set f17=O
  385. set g17=Û
  386.  
  387. set a18=O
  388. set b18=O
  389. set c18=O
  390. set d18=O
  391. set e18=O
  392. set f18=O
  393. set g18=O
  394. goto MOVEpipe1
  395. :pipe2To16
  396. set pipe2Row=16
  397. set a16=Û
  398. set b16=Û
  399. set c16=Û
  400. set d16=Û
  401. set e16=O
  402. set f16=O
  403. set g16=Û
  404.  
  405. set a17=O
  406. set b17=O
  407. set c17=O
  408. set d17=O
  409. set e17=O
  410. set f17=O
  411. set g17=O
  412. goto MOVEpipe1
  413. :pipe2To15
  414. set pipe2Row=15
  415. set a15=Û
  416. set b15=Û
  417. set c15=Û
  418. set d15=Û
  419. set e15=O
  420. set f15=O
  421. set g15=Û
  422.  
  423. set a16=O
  424. set b16=O
  425. set c16=O
  426. set d16=O
  427. set e16=O
  428. set f16=O
  429. set g16=O
  430. goto MOVEpipe1
  431. :pipe2To14
  432. set pipe2Row=14
  433. set a14=Û
  434. set b14=Û
  435. set c14=Û
  436. set d14=Û
  437. set e14=O
  438. set f14=O
  439. set g14=Û
  440.  
  441. set a15=O
  442. set b15=O
  443. set c15=O
  444. set d15=O
  445. set e15=O
  446. set f15=O
  447. set g15=O
  448. goto MOVEpipe1
  449. :pipe2To13
  450. set pipe2Row=13
  451. set a13=Û
  452. set b13=Û
  453. set c13=Û
  454. set d13=Û
  455. set e13=O
  456. set f13=O
  457. set g13=Û
  458.  
  459. set a14=O
  460. set b14=O
  461. set c14=O
  462. set d14=O
  463. set e14=O
  464. set f14=O
  465. set g14=O
  466. goto MOVEpipe1
  467. :pipe2To12
  468. set pipe2Row=12
  469. set a12=Û
  470. set b12=Û
  471. set c12=Û
  472. set d12=Û
  473. set e12=O
  474. set f12=O
  475. set g12=Û
  476.  
  477. set a13=O
  478. set b13=O
  479. set c13=O
  480. set d13=O
  481. set e13=O
  482. set f13=O
  483. set g13=O
  484. goto MOVEpipe1
  485. :pipe2To11
  486. set pipe2Row=11
  487. set a11=Û
  488. set b11=Û
  489. set c11=Û
  490. set d11=Û
  491. set e11=O
  492. set f11=O
  493. set g11=Û
  494.  
  495. set a12=O
  496. set b12=O
  497. set c12=O
  498. set d12=O
  499. set e12=O
  500. set f12=O
  501. set g12=O
  502. goto MOVEpipe1
  503. :pipe2To10
  504. set pipe2Row=10
  505. set a10=Û
  506. set b10=Û
  507. set c10=Û
  508. set d10=Û
  509. set e10=O
  510. set f10=O
  511. set g10=Û
  512.  
  513. set a11=O
  514. set b11=O
  515. set c11=O
  516. set d11=O
  517. set e11=O
  518. set f11=O
  519. set g11=O
  520. goto MOVEpipe1
  521. :pipe2To9
  522. set pipe2Row=9
  523. set a9=Û
  524. set b9=Û
  525. set c9=Û
  526. set d9=Û
  527. set e9=O
  528. set f9=O
  529. set g9=Û
  530.  
  531. set a10=O
  532. set b10=O
  533. set c10=O
  534. set d10=O
  535. set e10=O
  536. set f10=O
  537. set g10=O
  538. goto MOVEpipe1
  539. :pipe2To8
  540. set pipe2Row=8
  541. set a8=Û
  542. set b8=Û
  543. set c8=Û
  544. set d8=Û
  545. set e8=O
  546. set f8=O
  547. set g8=Û
  548.  
  549. set a9=O
  550. set b9=O
  551. set c9=O
  552. set d9=O
  553. set e9=O
  554. set f9=O
  555. set g9=O
  556. goto MOVEpipe1
  557. :pipe2To7
  558. set pipe2Row=7
  559. set a7=Û
  560. set b7=Û
  561. set c7=Û
  562. set d7=Û
  563. set e7=O
  564. set f7=O
  565. set g7=Û
  566.  
  567. set a8=O
  568. set b8=O
  569. set c8=O
  570. set d8=O
  571. set e8=O
  572. set f8=O
  573. set g8=O
  574. goto MOVEpipe1
  575. :pipe2To6
  576. set pipe2Row=6
  577. set a6=Û
  578. set b6=Û
  579. set c6=Û
  580. set d6=Û
  581. set e6=O
  582. set f6=O
  583. set g6=Û
  584.  
  585. set a7=O
  586. set b7=O
  587. set c7=O
  588. set d7=O
  589. set e7=O
  590. set f7=O
  591. set g7=O
  592. goto MOVEpipe1
  593. :pipe2To5
  594. set pipe2Row=5
  595. set a5=Û
  596. set b5=Û
  597. set c5=Û
  598. set d5=Û
  599. set e5=O
  600. set f5=O
  601. set g5=Û
  602.  
  603. set a6=O
  604. set b6=O
  605. set c6=O
  606. set d6=O
  607. set e6=O
  608. set f6=O
  609. set g6=O
  610. goto MOVEpipe1
  611. :pipe2To4
  612. set pipe2Row=4
  613. set a4=Û
  614. set b4=Û
  615. set c4=Û
  616. set d4=Û
  617. ::set e4=O
  618. ::set f4=O
  619. set g4=Û
  620.  
  621. set a5=O
  622. set b5=O
  623. set c5=O
  624. set d5=O
  625. set e5=O
  626. set f5=O
  627. set g5=O
  628. goto MOVEpipe1
  629. :pipe2To3
  630. set pipe2Row=3
  631. set a3=Û
  632. set b3=Û
  633. set c3=Û
  634. set d3=Û
  635. set e3=O
  636. set f3=O
  637. set g3=Û
  638.  
  639. set a4=O
  640. set b4=O
  641. set c4=O
  642. set d4=O
  643. ::set e4=O
  644. ::set f4=O
  645. set g4=O
  646. goto MOVEpipe1
  647. :pipe2To2
  648. set pipe2Row=2
  649. set a2=Û
  650. set b2=Û
  651. set c2=Û
  652. set d2=Û
  653. set e2=O
  654. set f2=O
  655. set g2=Û
  656.  
  657. set a3=O
  658. set b3=O
  659. set c3=O
  660. set d3=O
  661. set e3=O
  662. set f3=O
  663. set g3=O
  664. goto MOVEpipe1
  665. :pipe2To1
  666. set pipe2Row=1
  667. set a1=Û
  668. set b1=Û
  669. set c1=Û
  670. set d1=Û
  671. set e1=O
  672. set f1=O
  673. set g1=Û
  674.  
  675. set a2=O
  676. set b2=O
  677. set c2=O
  678. set d2=O
  679. set e2=O
  680. set f2=O
  681. set g2=O
  682. goto MOVEpipe1
  683. :pipe2To0
  684. set pipe2Row=0
  685. set a1=O
  686. set b1=O
  687. set c1=O
  688. set d1=O
  689. set e1=O
  690. set f1=O
  691. set g1=O
  692. goto MOVEpipe1
  693.  
  694. :pipeTo19
  695. set pipeRow=19
  696. set a19=Û
  697. set b19=Û
  698. set c19=O
  699. set d19=O
  700. set e19=Û
  701. set f19=Û
  702. set g19=Û
  703.  
  704. set a20=O
  705. set b20=O
  706. set c20=O
  707. set d20=O
  708. set e20=O
  709. set f20=O
  710. set g20=O
  711. goto MAP
  712. :pipeTo18
  713. set pipeRow=18
  714. set a18=Û
  715. set b18=Û
  716. set c18=O
  717. set d18=O
  718. set e18=Û
  719. set f18=Û
  720. set g18=Û
  721.  
  722. set a19=O
  723. set b19=O
  724. set c19=O
  725. set d19=O
  726. set e19=O
  727. set f19=O
  728. set g19=O
  729. goto MAP
  730. :pipeTo17
  731. set pipeRow=17
  732. set a17=Û
  733. set b17=Û
  734. set c17=O
  735. set d17=O
  736. set e17=Û
  737. set f17=Û
  738. set g17=Û
  739.  
  740. set a18=O
  741. set b18=O
  742. set c18=O
  743. set d18=O
  744. set e18=O
  745. set f18=O
  746. set g18=O
  747. goto MAP
  748. :pipeTo16
  749. set pipeRow=16
  750. set a16=Û
  751. set b16=Û
  752. set c16=O
  753. set d16=O
  754. set e16=Û
  755. set f16=Û
  756. set g16=Û
  757.  
  758. set a17=O
  759. set b17=O
  760. set c17=O
  761. set d17=O
  762. set e17=O
  763. set f17=O
  764. set g17=O
  765. goto MAP
  766. :pipeTo15
  767. set pipeRow=15
  768. set a15=Û
  769. set b15=Û
  770. set c15=O
  771. set d15=O
  772. set e15=Û
  773. set f15=Û
  774. set g15=Û
  775.  
  776. set a16=O
  777. set b16=O
  778. set c16=O
  779. set d16=O
  780. set e16=O
  781. set f16=O
  782. set g16=O
  783. goto MAP
  784. :pipeTo14
  785. set pipeRow=14
  786. set a14=Û
  787. set b14=Û
  788. set c14=O
  789. set d14=O
  790. set e14=Û
  791. set f14=Û
  792. set g14=Û
  793.  
  794. set a15=O
  795. set b15=O
  796. set c15=O
  797. set d15=O
  798. set e15=O
  799. set f15=O
  800. set g15=O
  801. goto MAP
  802. :pipeTo13
  803. set pipeRow=13
  804. set a13=Û
  805. set b13=Û
  806. set c13=O
  807. set d13=O
  808. set e13=Û
  809. set f13=Û
  810. set g13=Û
  811.  
  812. set a14=O
  813. set b14=O
  814. set c14=O
  815. set d14=O
  816. set e14=O
  817. set f14=O
  818. set g14=O
  819. goto MAP
  820. :pipeTo12
  821. set pipeRow=12
  822. set a12=Û
  823. set b12=Û
  824. set c12=O
  825. set d12=O
  826. set e12=Û
  827. set f12=Û
  828. set g12=Û
  829.  
  830. set a13=O
  831. set b13=O
  832. set c13=O
  833. set d13=O
  834. set e13=O
  835. set f13=O
  836. set g13=O
  837. goto MAP
  838. :pipeTo11
  839. set pipeRow=11
  840. set a11=Û
  841. set b11=Û
  842. set c11=O
  843. set d11=O
  844. set e11=Û
  845. set f11=Û
  846. set g11=Û
  847.  
  848. set a12=O
  849. set b12=O
  850. set c12=O
  851. set d12=O
  852. set e12=O
  853. set f12=O
  854. set g12=O
  855. goto MAP
  856. :pipeTo10
  857. set pipeRow=10
  858. set a10=Û
  859. set b10=Û
  860. set c10=O
  861. set d10=O
  862. set e10=Û
  863. set f10=Û
  864. set g10=Û
  865.  
  866. set a11=O
  867. set b11=O
  868. set c11=O
  869. set d11=O
  870. set e11=O
  871. set f11=O
  872. set g11=O
  873. goto MAP
  874. :pipeTo9
  875. set pipeRow=9
  876. set a9=Û
  877. set b9=Û
  878. set c9=O
  879. set d9=O
  880. set e9=Û
  881. set f9=Û
  882. set g9=Û
  883.  
  884. set a10=O
  885. set b10=O
  886. set c10=O
  887. set d10=O
  888. set e10=O
  889. set f10=O
  890. set g10=O
  891. goto MAP
  892. :pipeTo8
  893. set pipeRow=8
  894. set a8=Û
  895. set b8=Û
  896. set c8=O
  897. set d8=O
  898. set e8=Û
  899. set f8=Û
  900. set g8=Û
  901.  
  902. set a9=O
  903. set b9=O
  904. set c9=O
  905. set d9=O
  906. set e9=O
  907. set f9=O
  908. set g9=O
  909. goto MAP
  910. :pipeTo7
  911. set pipeRow=7
  912. set a7=Û
  913. set b7=Û
  914. set c7=O
  915. set d7=O
  916. set e7=Û
  917. set f7=Û
  918. set g7=Û
  919.  
  920. set a8=O
  921. set b8=O
  922. set c8=O
  923. set d8=O
  924. set e8=O
  925. set f8=O
  926. set g8=O
  927. goto MAP
  928. :pipeTo6
  929. set pipeRow=6
  930. set a6=Û
  931. set b6=Û
  932. set c6=O
  933. set d6=O
  934. set e6=Û
  935. set f6=Û
  936. set g6=Û
  937.  
  938. set a7=O
  939. set b7=O
  940. set c7=O
  941. set d7=O
  942. set e7=O
  943. set f7=O
  944. set g7=O
  945. goto MAP
  946. :pipeTo5
  947. set pipeRow=5
  948. set a5=Û
  949. set b5=Û
  950. set c5=O
  951. set d5=O
  952. set e5=Û
  953. set f5=Û
  954. set g5=Û
  955.  
  956. set a6=O
  957. set b6=O
  958. set c6=O
  959. set d6=O
  960. set e6=O
  961. set f6=O
  962. set g6=O
  963. goto MAP
  964. :pipeTo4
  965. set pipeRow=4
  966. set a4=Û
  967. set b4=Û
  968. ::set c4=O
  969. ::set d4=O
  970. set e4=Û
  971. set f4=Û
  972. set g4=Û
  973.  
  974. set a5=O
  975. set b5=O
  976. set c5=O
  977. set d5=O
  978. set e5=O
  979. set f5=O
  980. set g5=O
  981. goto MAP
  982. :pipeTo3
  983. set pipeRow=3
  984. set a3=Û
  985. set b3=Û
  986. set c3=O
  987. set d3=O
  988. set e3=Û
  989. set f3=Û
  990. set g3=Û
  991.  
  992. set a4=O
  993. set b4=O
  994. ::set c4=O
  995. ::set d4=O
  996. set e4=O
  997. set f4=O
  998. set g4=O
  999. goto MAP
  1000. :pipeTo2
  1001. set pipeRow=2
  1002. set a2=Û
  1003. set b2=Û
  1004. set c2=O
  1005. set d2=O
  1006. set e2=Û
  1007. set f2=Û
  1008. set g2=Û
  1009.  
  1010. set a3=O
  1011. set b3=O
  1012. set c3=O
  1013. set d3=O
  1014. set e3=O
  1015. set f3=O
  1016. set g3=O
  1017. goto MAP
  1018. :pipeTo1
  1019. set pipeRow=1
  1020. set a1=Û
  1021. set b1=Û
  1022. set c1=O
  1023. set d1=O
  1024. set e1=Û
  1025. set f1=Û
  1026. set g1=Û
  1027.  
  1028. set a2=O
  1029. set b2=O
  1030. set c2=O
  1031. set d2=O
  1032. set e2=O
  1033. set f2=O
  1034. set g2=O
  1035. goto MAP
  1036. :pipeTo0
  1037. set pipeRow=0
  1038. set a1=O
  1039. set b1=O
  1040. set c1=O
  1041. set d1=O
  1042. set e1=O
  1043. set f1=O
  1044. set g1=O
  1045. goto MAP
  1046.  
  1047. :testDeath
  1048. echo [%date% %time%] Checked for Death >> logs.txt
  1049. if %flappyCurrent% equ 1 goto OVER
  1050. if %flappyCurrent% equ 2 goto OVER
  1051. if %flappyCurrent% equ 5 goto OVER
  1052. if %flappyCurrent% equ 6 goto OVER
  1053. if %flappyCurrent% equ 7 goto OVER
  1054. set alive=true
  1055. goto MAP
  1056.  
  1057. :testDeath1
  1058. echo [%date% %time%] Checked for Death >> logs.txt
  1059. if %flappyCurrent% equ 1 goto OVER
  1060. if %flappyCurrent% equ 2 goto OVER
  1061. if %flappyCurrent% equ 3 goto OVER
  1062. if %flappyCurrent% equ 4 goto OVER
  1063. if %flappyCurrent% equ 7 goto OVER
  1064. set alive=true
  1065. goto MAP
  1066.  
  1067. ::===========================================================================
  1068. ::MAPPING
  1069. ::===========================================================================
  1070. :MAP
  1071. if %alive% equ true goto MAP1
  1072. if %pipeRow% equ 4 goto testDeath
  1073. if %pipe2Row% equ 4 goto testDeath1
  1074. :MAP1
  1075. echo [%date% %time%] Displayed Map >> logs.txt
  1076. set alive=false
  1077. ::MAP
  1078. cls
  1079. echo %a1%%a2%%a3%%a4%%a5%%a6%%a7%%a8%%a9%%a10%%a11%%a12%%a13%%a14%%a15%%a16%%a17%%a18%%a19%%a20%
  1080. echo %b1%%b2%%b3%%b4%%b5%%b6%%b7%%b8%%b9%%b10%%b11%%b12%%b13%%b14%%b15%%b16%%b17%%b18%%b19%%b20%
  1081. echo %c1%%c2%%c3%%c4%%c5%%c6%%c7%%c8%%c9%%c10%%c11%%c12%%c13%%c14%%c15%%c16%%c17%%c18%%c19%%c20%
  1082. echo %d1%%d2%%d3%%d4%%d5%%d6%%d7%%d8%%d9%%d10%%d11%%d12%%d13%%d14%%d15%%d16%%d17%%d18%%d19%%d20%
  1083. echo %e1%%e2%%e3%%e4%%e5%%e6%%e7%%e8%%e9%%e10%%e11%%e12%%e13%%e14%%e15%%e16%%e17%%e18%%e19%%e20%
  1084. echo %f1%%f2%%f3%%f4%%f5%%f6%%f7%%f8%%f9%%f10%%f11%%f12%%f13%%f14%%f15%%f16%%f17%%f18%%f19%%f20%
  1085. echo %g1%%g2%%g3%%g4%%g5%%g6%%g7%%g8%%g9%%g10%%g11%%g12%%g13%%g14%%g15%%g16%%g17%%g18%%g19%%g20%
  1086. echo --------------------
  1087. echo Score: %score%
  1088.  
  1089. ::===========================================================================
  1090. ::MOVEMENT
  1091. ::===========================================================================
  1092. ::-MOVEMENT
  1093. echo [%date% %time%] Moved Objects >> logs.txt
  1094. ping localhost -n 2 > nul
  1095. findstr /i "UP" movement
  1096. if %errorlevel% equ 1 goto gravity
  1097. echo NONE > movement
  1098. if %flappyCurrent% equ 2 goto move1
  1099. if %flappyCurrent% equ 3 goto move2
  1100. if %flappyCurrent% equ 4 goto move3
  1101. if %flappyCurrent% equ 5 goto move4
  1102. if %flappyCurrent% equ 6 goto move5
  1103. if %flappyCurrent% equ 7 goto move6
  1104. goto gravity
  1105.  
  1106. :gravity
  1107. echo [%date% %time%] Applied Gravity >> logs.txt
  1108. if %flappyCurrent% equ 1 goto down2
  1109. if %flappyCurrent% equ 2 goto down3
  1110. if %flappyCurrent% equ 3 goto down4
  1111. if %flappyCurrent% equ 4 goto down5
  1112. if %flappyCurrent% equ 5 goto down6
  1113. if %flappyCurrent% equ 6 goto down7
  1114. if %flappyCurrent% equ 7 goto OVER
  1115.  
  1116. :move1
  1117. set b4=O
  1118. set a4=Û
  1119. set flappyCurrent=1
  1120. goto GAME_LOOP
  1121. :move2
  1122. set c4=O
  1123. set b4=Û
  1124. set flappyCurrent=2
  1125. goto GAME_LOOP
  1126. :move3
  1127. set d4=O
  1128. set c4=Û
  1129. set flappyCurrent=3
  1130. goto GAME_LOOP
  1131. :move4
  1132. set e4=O
  1133. set d4=Û
  1134. set flappyCurrent=4
  1135. goto GAME_LOOP
  1136. :move5
  1137. set f4=O
  1138. set e4=Û
  1139. set flappyCurrent=5
  1140. goto GAME_LOOP
  1141. :move6
  1142. set g4=O
  1143. set f4=Û
  1144. set flappyCurrent=6
  1145. goto GAME_LOOP
  1146.  
  1147. :down2
  1148. set a4=O
  1149. set b4=Û
  1150. set flappyCurrent=2
  1151. goto GAME_LOOP
  1152. :down3
  1153. set b4=O
  1154. set c4=Û
  1155. set flappyCurrent=3
  1156. goto GAME_LOOP
  1157. :down4
  1158. set c4=O
  1159. set d4=Û
  1160. set flappyCurrent=4
  1161. goto GAME_LOOP
  1162. :down5
  1163. set d4=O
  1164. set e4=Û
  1165. set flappyCurrent=5
  1166. goto GAME_LOOP
  1167. :down6
  1168. set e4=O
  1169. set f4=Û
  1170. set flappyCurrent=6
  1171. goto GAME_LOOP
  1172. :down7
  1173. set f4=O
  1174. set g4=Û
  1175. set flappyCurrent=7
  1176. goto GAME_LOOP
  1177.  
  1178. ::===========================================================================
  1179. ::GAME OVER
  1180. ::===========================================================================
  1181. ::-END
  1182. :OVER
  1183. cd %pjpath%
  1184. echo [%date% %time%] Game Ended >> logs.txt
  1185. echo END > gamestate
  1186. if %score% geq %highscore% set newHigh=1
  1187. cls
  1188. echo You lost!
  1189. echo Your Score: %score%
  1190. if %newHigh% equ 1 echo New Highscore!
  1191. if %newHigh% equ 1 set highscore=%score%
  1192. echo Press Enter to Exit
  1193. pause>nul
  1194. if %newHigh% equ 1 goto saveScore
  1195. goto menu
  1196.  
  1197. :saveScore
  1198. cd %pjpath%
  1199. echo [%date% %time%] Saved Highscore >> logs.txt
  1200. cd data
  1201. del /f /q save.sav
  1202. type nul > save.tmp
  1203. echo set highscore=%highscore% > save.tmp
  1204. certutil -encode save.tmp save.sav
  1205. del /f /q save.tmp
  1206. goto menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement