Advertisement
lyonlyke

SPACE DOLLAR SLALOM (touch screen opposed thumb steer)

Jun 19th, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.32 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en-us">
  3. <head>
  4. <title>SPACE DOLLAR SLALOM</title>
  5. <!-- for-mobile-apps -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  8.  
  9. <!-- //for-mobile-apps -->
  10.  
  11. <!-- Authored by: Lionel Mertens on June 12, 2019 for all to enjoy -->
  12.  
  13. <!-- Just clip and paste this text to a text editor and save it with the extension .html. And run it in your Chrome Browser. It should work. -->
  14.  
  15.  
  16. <style>
  17. /*-- start of calculator styles --*/
  18. /* reset css */
  19.  
  20.  
  21.  
  22. html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  23. margin: 0;
  24. padding: 0;
  25. border: 0;
  26. font-size: 100%;
  27. font: inherit;
  28. vertical-align: baseline
  29. }
  30.  
  31. article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block }
  32.  
  33. body { line-height: 1 }
  34.  
  35. ol, ul { list-style: none }
  36.  
  37. blockquote, q { quotes: none }
  38.  
  39. blockquote:before, blockquote:after, q:before, q:after {
  40. content: '';
  41. content: none
  42. }
  43.  
  44. table {
  45. border-collapse: collapse;
  46. border-spacing: 0
  47. }
  48.  
  49.  
  50.  
  51. a { text-decoration: none; }
  52.  
  53. body{background:none;
  54. text:align:center;
  55. margin:0;
  56. }
  57. p{margin:4px 0 0 0;padding:0;
  58. }
  59.  
  60.  
  61. #lert {
  62. display:none;
  63. position:absolute;
  64. top:30px;
  65. width:280px;
  66. height:auto;
  67. margin:auto calc(50% - 147px);
  68. padding:5px;
  69. background-color:white;
  70. border-radius:5px;
  71. border: 2px solid gray;
  72. z-index:6;
  73. }
  74.  
  75. #lert p {
  76. font-family: 'Arial', Helvetica, Sans-Serif;
  77. font-size: 14px;
  78. font-weight: 700;
  79.  
  80. color:black;
  81. text-align:justify;
  82. margin-bottom:10px;
  83. }
  84.  
  85. #lert p#combo {text-align: center;}
  86.  
  87. #lert p#combo mark {
  88. padding:0 5px;
  89. text-align: center;
  90. font-family: 'Arial', Helvetica, Sans-Serif;
  91. font-size: 20px;font-weight: 900;
  92. }
  93.  
  94. #lert h1 {
  95. font-family: Serif;
  96. font-size: 30px;
  97. font-weight: 900;
  98. text-align: center;
  99. color:OrangeRed;
  100. background-color:yellow;
  101. border-radius:3px;
  102. border: 1px solid silver;
  103. margin-bottom:20px;
  104. letter-spacing:3px;
  105. word-spacing:10px;
  106. }
  107.  
  108. #lert h2 {
  109. font-family: Sans-Serif;
  110. font-size: 14px;
  111. font-weight: 900;
  112. text-align: left;
  113. color: red;
  114. margin-bottom:20px;
  115. }
  116.  
  117. #lert span {color:blue;}
  118.  
  119. #lert h3 {
  120. font-family: Serif;
  121. font-size: 24px;
  122. font-weight: 900;
  123. text-align: center;
  124. border: 1px solid navy;
  125. background-color: MidnightBlue;
  126. color:white;
  127. border-radius:2px;
  128. margin-bottom:10px;
  129. letter-spacing:3px;
  130. word-spacing:10px;
  131. padding:6px 0;
  132. }
  133.  
  134.  
  135. #lert h4 {
  136. font-family: Sans-Serif;
  137. font-size: 18px;
  138. font-weight: 900;
  139. text-align: center;
  140. background-color:red;
  141. color:yellow;
  142. border:2px solid orange;
  143. border-radius:2px;
  144. margin-bottom:0;
  145. letter-spacing:1px;
  146. word-spacing:5px;
  147. padding:6px 2px;
  148.  
  149. }
  150.  
  151.  
  152.  
  153. #lert b {color:black;}
  154.  
  155.  
  156. #wrapper {
  157. position:absolute;
  158. bottom:10px;
  159. display:none;
  160. margin:0;
  161. width:100%;
  162. height:280px;
  163. z-index:6;
  164.  
  165. }
  166.  
  167.  
  168. #box{
  169. background-color:#313131;
  170. height:280px;
  171. width:260px;
  172. margin:15px auto;
  173. border-radius:10px;
  174. position:absolute;
  175. bottom:0;
  176. margin:auto calc(50% - 132px);
  177. text:align:center;
  178. border:2px double #333;
  179. box-shadow:0 0 3px 4px rgba(0, 0, 0, 0.25);
  180. }
  181.  
  182. #lcd{
  183. background-color:#222;
  184. width:200px;
  185. position:relative;
  186. left:24px;
  187. top:19px;
  188. height:30px;
  189. }
  190.  
  191.  
  192.  
  193. #lcd input{
  194. position:relative;
  195. left:2px;
  196. top:2px;
  197. width:196px;
  198. height:25px;
  199. color:#383838;
  200. background-color:#bccd95;
  201. font-size:16px;
  202. font-weight: 700;
  203. text-align:right;
  204. padding:2px;
  205. }
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212. #keypad {
  213. position:relative;
  214. top:38px;
  215. left:20px;
  216. }
  217.  
  218.  
  219.  
  220.  
  221. .buttn{
  222. width:64px;
  223. height:44px;
  224. border:none;
  225. border-radius:8px;
  226. margin-left:5px;
  227. cursor:pointer;
  228. font-family: Sans-Serif;
  229. font-size: 20px;
  230. font-weight: 900;
  231. color:#FFF;
  232. text-shadow:
  233. -0.5px 0px 1px #EB8,
  234. 0px 0.5px 1px #EB8,
  235. 0.5px 0px 1px #EB8,
  236. 0px -0.5px 1px #EB8;
  237. box-shadow:inset 0px 0px 15px rgba(0, 0, 0, 0.25),
  238. 0px 0px 1px 1px #222;
  239. ;
  240. }
  241.  
  242.  
  243.  
  244. .btn:active {
  245. box-shadow:0px 0px 2px 2px #303030;
  246. }
  247.  
  248.  
  249. .buttn.nums{
  250. background-color:#C96;
  251. }
  252.  
  253. .buttn.nums:hover{background-color:#EB8;}
  254.  
  255. .buttn.nums:active {
  256. background-color:#C96;
  257.  
  258. }
  259.  
  260.  
  261. .buttn#okay {
  262. background-color:#FF9933;
  263.  
  264. }
  265.  
  266.  
  267. .buttn#okay:hover {
  268. background-color:#FFA448;
  269. }
  270.  
  271. .buttn#okay:active {
  272. background-color:#FF9933;
  273.  
  274. ;
  275. }
  276.  
  277. .buttn#clearall {
  278. background-color:#4D6E96;
  279. }
  280.  
  281.  
  282. .buttn#clearall:hover {background-color:#6587AF;}
  283.  
  284. .buttn#clearall:active {
  285. background-color:#4D6E96;
  286.  
  287. }
  288.  
  289. input:focus {outline:none;}
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297. body {
  298.  
  299. margin:0 calc(50% - 164px);
  300. background-color:#820000;
  301. overflow-x:hidden;
  302. overflow-y:hidden;
  303. }
  304.  
  305.  
  306. #space {
  307. position:absolute;
  308. width:310px;
  309. height:100%;
  310. background-color:#000;
  311. margin-left:10px;
  312. padding-top:.5%;
  313. }
  314.  
  315. #corridor {
  316. position:relative;
  317. height:98%;
  318. width:296px;
  319. margin:auto;
  320. background-color:#000;
  321. border-left: 1px solid #000;
  322. border-right: 1px solid #000;
  323.  
  324. z-index:2;
  325. }
  326.  
  327.  
  328.  
  329.  
  330. #spaceShip
  331. {
  332. display:none;
  333. position:absolute;
  334. width:25px;
  335. height:35px;
  336. stroke:lime;
  337. bottom:80px;
  338. left:calc(50% - 12px);
  339. z-index:3;
  340.  
  341. }
  342.  
  343. #explosion2 {display:none;}
  344.  
  345.  
  346.  
  347. .roids,
  348. .coins {
  349. display:none;
  350. position:absolute;
  351. width:25px;
  352. height:25px;
  353. top:0;
  354. z-index:2;
  355. background-color:transparent;
  356. }
  357.  
  358.  
  359.  
  360. #coin1 {left:65px;}
  361. #coin2 {left:130px;}
  362. #coin3 {left:205px;}
  363.  
  364.  
  365. #roid1 {left:15px;}
  366. #roid2 {left:40px;}
  367. #roid3 {left:80px;}
  368. #roid4 {left:105px;}
  369. #roid5 {left:155px;}
  370. #roid6 {left:180px;}
  371. #roid7 {left:230px;}
  372. #roid8 {left:255px;}
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380. hr.laser {
  381. display:none;
  382. position:absolute;
  383. border:1px solid orange;
  384. top:0;
  385. z-index:2;
  386. }
  387.  
  388.  
  389. #laser1 {width:25px;left:0;}
  390. #laser2 {width:50px;left:0;}
  391. #laser3 {width:75px;left:0;}
  392. #laser4 {width:100px;left:0;}
  393. #laser5 {width:25px;left:0;}
  394. #laser6 {width:50px;left:0;}
  395. #laser7 {width:75px;left:0;}
  396. #laser8 {width:100px;left:0;}
  397.  
  398.  
  399. #laser9 {width:25px;right:0;}
  400. #laser10 {width:50px;right:0;}
  401. #laser11 {width:75px;right:0;}
  402. #laser12 {width:100px;right:0;}
  403. #laser13 {width:25px;right:0;}
  404. #laser14 {width:50px;right:0;}
  405. #laser15 {width:75px;right:0;}
  406. #laser16 {width:100px;right:0;}
  407.  
  408.  
  409. #controls {
  410. position:absolute;
  411. display:none;
  412. width:290px;
  413. height:auto;
  414. bottom:0;
  415. left: calc(50% - 145px);
  416. margin:0;
  417. z-index:5;
  418. text-align:center;
  419.  
  420. }
  421.  
  422. #controls div.ext{
  423. position:relative;
  424. display:inline-block;
  425. float:left;
  426. width:auto;
  427. height:80px;
  428. margin:0;
  429. padding:0;
  430.  
  431. }
  432.  
  433.  
  434. #controls div.steer {
  435. display:inline-block;
  436. float:left;
  437. width:110px;
  438. line-height:40px;
  439. font-size:16px;
  440. font-family:sans-serif;
  441. font-weight:normal;
  442. margin-top:40px;
  443. padding:0;
  444. border:none;
  445. border-radius:2px;
  446. box-shadow:inset 0 0 5px #000;
  447. vertical-align:bottom;
  448. background-color:#DDD;
  449.  
  450. }
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457. #controls div#steerL {
  458. float:left;
  459. width:145px;
  460. line-height:40px;
  461.  
  462. }
  463.  
  464. #controls div#steerR {
  465. float:left;
  466. width:145px;
  467. line-height:40px;
  468.  
  469. }
  470.  
  471.  
  472. #stats {
  473. position:absolute;
  474. top:0;
  475. margin:0;
  476. width:100%;
  477. left:0;
  478. z-index:6;
  479. display:none;
  480. }
  481.  
  482.  
  483.  
  484.  
  485. #points {
  486.  
  487. position:relative;
  488. text-align:right;
  489. float:left;
  490. margin-left:2px;
  491. width:176px;
  492. height:16px;
  493. line-height:16px;
  494. font-size:12px;
  495. font-family:Sans-Serif;
  496. border-radius:2px;
  497. background-color:#fff;
  498. color:#000;
  499. padding-left:4px;
  500. padding-right:4px;
  501.  
  502. }
  503.  
  504. #points:before {content:"Score: ";float:left;}
  505.  
  506. #fuelGage {
  507.  
  508. position:relative;
  509. float:right;
  510. margin-right:2px;
  511. min-width:100px;
  512. height:16px;
  513. border-radius:2px;
  514. background-color:yellow;
  515. height:16px;
  516. line-height:16px;
  517. font-size:8px;
  518. font-family: Sans-Serif;
  519. letter-spacing:.5px;
  520. text-indent:4px;
  521. color:red;
  522. z-index:4;
  523.  
  524. }
  525.  
  526. #fuelGage:before {content:"FUEL";position:absolute;float:left;}
  527.  
  528.  
  529. #fuelGage span {
  530. position:absolute;
  531. height:16px;
  532. width:30px;
  533. background-color:red;
  534. right:0;
  535. border-left:30px solid orange;
  536. border-radius:2px;
  537. z-index:1;
  538. margin:0;
  539. padding:0;
  540. }
  541.  
  542.  
  543. #fuelLevel {
  544. position:relative;
  545. float:right;
  546. margin:0;
  547. padding:0;
  548. border: 8px solid lime;
  549. border-left:0;
  550. border-right:0;
  551. border-radius:2px;
  552. max-width:100px;
  553. z-index:4;
  554. }
  555.  
  556.  
  557.  
  558. #points p,
  559. #time p {
  560. margin:0;
  561. }
  562.  
  563. button {margin:0;}
  564.  
  565.  
  566.  
  567.  
  568. #starz1,
  569. #starz2,
  570. #starz3,
  571. #starz4,
  572. #starz5,
  573. #starz6,
  574. #starz7,
  575. #starz8,
  576. #starz9,
  577. #starz10,
  578. #starz11,
  579. #starz12,
  580. #starz13,
  581. #starz14,
  582. #starz15,
  583. #starz16 {
  584. position:absolute;
  585. width:auto;
  586. height:auto;
  587. font-family:sans-serif;
  588. font-size:8px;
  589. font-weight:900;
  590. color:#000;
  591. top:0;
  592. z-index:0;
  593. animation:streak 14s infinite linear;
  594.  
  595. }
  596.  
  597.  
  598.  
  599. @keyframes streak {
  600.  
  601. from{top:0%;color:#fff;}
  602. to{top:100%}
  603. }
  604.  
  605.  
  606.  
  607.  
  608. #starz1 {left:2px;animation-delay: 8.5s;}
  609. #starz2 {left:22px;animation-delay: 10.5s;font-size:12px;}
  610. #starz3 {left:42px;animation-delay: 0s;font-size:12px;}
  611. #starz4 {left:62px;animation-delay: 7.5s;}
  612. #starz5 {left:82px;animation-delay: 6s;font-size:12px;}
  613. #starz6 {left:102px;animation-delay: 14.5s;}
  614. #starz7 {left:122px;animation-delay: 11.5s;font-size:12px;}
  615. #starz8 {left:142px;animation-delay: 4s;}
  616.  
  617. #starz9 {left:162px;animation-delay: 3s;font-size:12px;}
  618. #starz10 {left:182px;animation-delay: 15.5s;}
  619. #starz11 {left:202px;animation-delay: 12.5s;}
  620. #starz12 {left:222px;animation-delay: 1s;font-size:12px;}
  621. #starz13 {left:242px;animation-delay: 9.5s;font-size:12px;}
  622. #starz14 {left:262px;animation-delay: 7s;}
  623. #starz15 {left:282px;animation-delay: 2s;font-size:12px;}
  624. #starz16 {left:292px;animation-delay: 13.5s;}
  625.  
  626.  
  627. #station {
  628. position:absolute;
  629. top:-158px;
  630. width:237.5px;
  631. height:157.5px;
  632. margin:0 calc(50% - 119px);
  633. background-color:transparent;
  634. display:none;
  635. z-index:4;
  636. }
  637.  
  638. #tractorBeam {
  639. position:absolute;
  640. top:53%;
  641. width:136px;
  642. height:0;
  643. border-left:.25px solid yellow;
  644. border-right:.25px solid yellow;
  645. background-color:GreenYellow;
  646. left:38px;
  647. display:none;
  648. z-index:3;
  649. }
  650.  
  651.  
  652. #dock {
  653. stroke:orange;
  654. stroke-width:4;
  655. fill:lime;
  656. }
  657.  
  658. #enter {
  659. font-size: 10px;
  660. font-weight: 900;
  661. font-family: Sans-Serif;
  662. letter-spacing: 6px;
  663. fill:white;
  664. }
  665.  
  666. #closed {
  667. font-size: 10px;
  668. font-weight: 900;
  669. font-family: Sans-Serif;
  670. letter-spacing: 5px;
  671. fill:white;
  672. display:none;
  673. }
  674.  
  675. #thruster {
  676. stroke:orange;
  677. stroke-width:1.5;
  678. fill:yellow;
  679. }
  680.  
  681. #prologue,
  682. #epitaph{
  683. width:100%;
  684. position:absolute;
  685. top:0;
  686. bottom:0;
  687. left:0;
  688. right:0;
  689. transform-origin:50% 100%;
  690. transform:perspective(400px) rotateX(20deg);
  691. color:yellow;
  692. background:black;
  693. }
  694.  
  695.  
  696.  
  697. #prologue:after,
  698. #epitaph:after {
  699. content:'';
  700. position:absolute;
  701. top:0;
  702. bottom:0;
  703. left:0;
  704. right:0;
  705. background:linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0) 100%);
  706. background:linear-gradient(to bottom,rgba(0,0,0,1),rgba(0,0,0,0) 100%);
  707.  
  708. }
  709.  
  710.  
  711. #opener,
  712. #closer {
  713. position:absolute;
  714. margin:0 calc(50% - 140px);
  715. top:0;
  716. bottom:0;
  717. left:0;
  718. right:0;
  719. overflow:hidden;
  720. overflow-y:hidden;
  721. font-size:20px;
  722. text-align:justify;
  723. font-family:sans-serif;
  724. }
  725.  
  726. #opener>div,
  727. #closer>div {
  728. padding-top:640px;
  729. animation:autoscroll 90s linear;
  730. animation-iteration-count:infinite;
  731. animation-fill-mode:forwards;
  732.  
  733. overflow:hidden;
  734. }
  735.  
  736. #opener>div p,
  737. #closer>div p {
  738. letter-spacing:1px;
  739. word-spacing:1px;
  740. margin-bottom:10px;
  741. }
  742.  
  743.  
  744. #epitaph,
  745. #closer {display:none;}
  746.  
  747.  
  748. @keyframes autoscroll {
  749. to{margin-top:-1700px;}
  750. }
  751.  
  752.  
  753.  
  754.  
  755.  
  756. #starter1,
  757. #starter2,
  758. #lert button {
  759. position:absolute;
  760. top:4%;
  761. display:block;
  762. margin:5px calc(50% - 60px);
  763. width:120px;
  764. text-align:center;
  765. background-color:#008080;
  766. border:1px solid #008080;
  767. border-radius:3px;
  768. padding:2px 0;
  769. color:#FFF;
  770. font-family: 'Arial', Helvetica, Sans-Serif;
  771. font-size:12px;
  772. font-weight:700;
  773. text-decoration:none;
  774. letter-spacing:2px;
  775. box-shadow:0px 0px 2px 2px cyan;
  776. z-index:6;
  777. }
  778.  
  779. #lert button {margin-top:10px;}
  780.  
  781. #starter1:hover,
  782. #starter2:hover,
  783. #lert:hover button {color:cyan;}
  784.  
  785. #starter1:active,
  786. #starter2:active,
  787. #lert:active button {
  788. box-shadow:0px 0px 3px 3px cyan, 0px 0px 2px 2px lime;
  789. color:#FFF;}
  790.  
  791. #lert button {
  792. position:relative;
  793. margin:0;
  794. width:100%;}
  795.  
  796.  
  797. #starter2 {display:none;}
  798.  
  799. #holder {
  800. position:absolute;
  801. top:-100px;
  802. margin:25% calc(50% - 55px);
  803. width:110px;
  804. height:110px;
  805. background-color:gold;
  806. z-index:4;
  807. display:none;
  808. }
  809.  
  810.  
  811. #cont {
  812. position:relative;
  813. margin:5px;
  814. height:100px;
  815. width:100px;
  816. background-color:cyan;
  817.  
  818.  
  819. }
  820.  
  821.  
  822.  
  823.  
  824. .fraame {
  825. position:absolute;
  826. height:100px;
  827. width:100px;
  828. border-radius:2%;
  829.  
  830. }
  831.  
  832. #fraame1 {
  833. background-color:cyan;
  834. transform:rotate(0deg);
  835.  
  836. }
  837.  
  838.  
  839. #fraame2 {
  840. background-color:aqua;
  841. transform:rotate(22.5deg);
  842. }
  843.  
  844.  
  845.  
  846. #fraame3 {
  847. background-color:Turquoise;
  848. transform:rotate(45deg);
  849.  
  850. }
  851.  
  852.  
  853.  
  854. #fraame4 {
  855. background-color:DarkTurquoise;
  856. transform:rotate(67.5deg);
  857. }
  858.  
  859. #fraame5 {
  860. height:98px;
  861. width:98px;
  862. background-color:gold;
  863. border:1px solid white;
  864.  
  865. border-radius:50%;
  866.  
  867. background:gold;
  868. background:-moz-linear-gradient(top, gold 0%, yellow 100%);
  869. background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, gold), color-stop(100%, yellow));
  870. background:-webkit-linear-gradient(top, gold 0%, yellow 100%);
  871. background:-o-linear-gradient(top, gold 0%, yellow 100%);
  872. background:-ms-linear-gradient(top, gold 0%, yellow 100%);
  873. background:linear-gradient(to bottom, gold 0%, yellow 100%);
  874. /*filter:progid:DXImageTransform.Mic.social_icrosoft.gradient(startColorstr='gold', endColorstr='yellow', GradientType=0);*/
  875. margin:0;
  876.  
  877.  
  878. }
  879.  
  880.  
  881. </style>
  882.  
  883.  
  884. <script>
  885. screenHeight = screen.availHeight;
  886. travel = screen.availHeight - 125;
  887. deadCenter = 155;
  888. shipX = 0;
  889. shipY = 0;
  890. novaY = -100;
  891. rotation = 0;
  892. stationY = 0;
  893. forceField = 'off';
  894. shift = 0;
  895. coinz = 0;
  896. coinValue = 100;
  897. cyclez = 1;
  898. numCyclez = 100;
  899. milez = 0;
  900. stage = 1;
  901. finalStage = 6;
  902. nestEgg = 0;
  903. tries = 3;
  904. gasFee = 500;
  905. lowFuel = 'full';
  906.  
  907. bay = false;
  908. fuelLev = 100;
  909. TBheight = 0;
  910. lockedON = false;
  911. turn = 0;
  912. game = 'on';
  913.  
  914. roidTrans = new Array (0,0,0,0,0,0,0,0);
  915. roidX = new Array (15,40,80,105,155,180,230,255);
  916. roidDisp = new Array (0,0,0,0,0,0,0,0);
  917.  
  918.  
  919. roidRot = new Array (0,0,0,0,0,0,0,0);
  920. roidRotDir = new Array (1,-1,2,-2,3,-3,1,-1);
  921. roidColor = new Array ('#996515','#8B4513','#A0522D','#555','#444',' #D2691E','#696969',' #353535');
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930. coinTrans = new Array (0,0,0);
  931. coinX = new Array (65,130,205);
  932. coinDisp = new Array (0,0,0);
  933. coinSpin = 0;
  934.  
  935. laserTrans = new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  936. laserX = new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  937. laserDisp = new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  938.  
  939.  
  940. roidPoints = new Array (
  941. '10,1 13,3 19,2 24,8 22,13 23,16 21,21 19,21 15,23 11,21 7,22 3,21 2,17 3,14 1,8 4,6 5,3 10,1',
  942. '10,1 13,5 18,3 22,4 24,9 23,14 20,16 18,22 13,23 10,22 8,18 3,16 1,13 2,9 4,8 3,3 5,0.5 10,1',
  943. '12,3 16,4 21,6 23,9 21,15 19,18 15,20 10,19 6,17 3,15 1,11 3,7 8,4 12,3',
  944. '15,2 19,4 20,9 23,12 22,15 23,18 22,20 20,21 15,22 8,20 4,15 3,10 5,6 9,5 11,3 15,2',
  945. '12,2 16,3 19,4 20,7 21,13 23,17 24,18 24.5,20 22,23 18,24 13,24 9,23 4,23 2,20 2,17 4,15 3,9 5,5 8,3 12,2',
  946. '12,3 18,6 20,9 21,13 20,17 17,22 14,24 5,22 3,20 1,14 3,10 7,8 9,4 12,3',
  947. '14,2 17,3 21,7 23,10 24,14 23,17 21,20 18,22 12,24 7,24 4,22 2,20 1,15 2,10 3,7 5,4 8,2 11,1.5 14,2',
  948. '5,4 8,5 14,6 19,11 21,16 20,20 18,22 14,22.5, 10,21 8,19 5,15 3,11 2,8 3,5'
  949. );
  950.  
  951.  
  952. widHeight = 100;
  953. d = new Array (1,1,-1,-1,1,-1,-1,1,0,1,1,0);
  954. p = new Array (0,0,0,0,0,0,0,0,0,0,0,0);
  955.  
  956.  
  957.  
  958.  
  959.  
  960. /* BEGIN FUNCTION LIST */
  961.  
  962.  
  963.  
  964. /* ----<< STAART >>----- */
  965.  
  966.  
  967. function staart(){
  968.  
  969. destructCode = new Array ('');
  970. var timez = finalStage - 1;
  971.  
  972. for(t = 0;t < timez;t++)
  973. {
  974. destructCode.push('*');
  975. }
  976.  
  977. startGame();
  978. }
  979.  
  980.  
  981.  
  982.  
  983. /* ----<< START GAME >>----- */
  984.  
  985. function startGame() {
  986.  
  987. starzTog(1);
  988. var divz = new Array ('starter1','prologue','opener','epitaph','closer','lert','spaceShip','controls','stats');
  989. var t = 0;
  990.  
  991. for(i = 0;i < divz.length;i++){
  992.  
  993. if(i > 5){var t = 1;}
  994.  
  995. deezPlay(divz[i],t);
  996. }
  997.  
  998.  
  999. postStats('points',coinz);
  1000. var m = fuelLev + 'px';
  1001. setProperty('fuelLevel','width',m);
  1002.  
  1003. stopRoids = setInterval(startRoids,0010);
  1004. stopCourse = setInterval(startCourse,0900);
  1005. stopSteer = setInterval(steerShip,0006);
  1006. stopForceField = setInterval(fieldON,2000);
  1007. }
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018. function starzTog(t){
  1019.  
  1020. for(n = 1;n < 17;n++){
  1021.  
  1022. var ID = 'starz' + n;
  1023.  
  1024. deezPlay(ID,t);
  1025. }
  1026.  
  1027. }
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037. function payForward(){
  1038.  
  1039. function reDo(){clearCode();return;}
  1040.  
  1041. function reStart(){
  1042. clearCode();
  1043. codeSelect('Are You Paying Forward?');
  1044. postStats('points',coinz);
  1045. keyPad(1);startGame();
  1046. }
  1047.  
  1048.  
  1049. var forAmt = document.getElementById('readOut').value;
  1050. var advance = parseInt(forAmt);
  1051.  
  1052.  
  1053. if((forAmt == null) || (isNaN(advance)) || (forAmt == '')){reDo();}
  1054.  
  1055.  
  1056. else{
  1057.  
  1058. if(advance > coinz){reDo();}
  1059. else{
  1060. coinz = coinz - advance;
  1061. nestEgg = nestEgg + advance;
  1062. reStart();
  1063. }
  1064.  
  1065. }
  1066. }
  1067.  
  1068.  
  1069.  
  1070. function clearCode(){var val = '';document.getElementById('readOut').value=val;}
  1071.  
  1072.  
  1073. function codeSelect(val){document.getElementById('readOut').value+=val;}
  1074.  
  1075.  
  1076. function matchEntry(){
  1077.  
  1078. function reDo(){clearCode();return;}
  1079.  
  1080. var codeEntry = document.getElementById('readOut').value;
  1081.  
  1082. var cEntry = parseInt(codeEntry);
  1083.  
  1084. if(isNaN(cEntry)){clearCode();matchEntry();}
  1085.  
  1086.  
  1087. if(codeEntry == Dcode){
  1088.  
  1089. clearCode();
  1090. codeSelect('Destruct Mode Activated ');
  1091. nestEgg = nestEgg + 10000;
  1092. var reward = topScore();
  1093. var top = localStorage.topScore;
  1094. setTimeout(Dstruct,03333);
  1095.  
  1096. }
  1097. else{
  1098.  
  1099.  
  1100. tries--;
  1101.  
  1102. switch(tries){
  1103. case 1:
  1104. var t = tries + ' try';
  1105. break;
  1106.  
  1107. default:
  1108. var t = tries + ' tries';
  1109. }
  1110.  
  1111. var a = ' ';
  1112. var b = ' ';
  1113. var c = ' ';
  1114.  
  1115.  
  1116. clearCode();codeSelect('WRONG! '+a+' '+b+''+t+' left '+c+' ');
  1117.  
  1118. if(tries < 1){
  1119.  
  1120. clearInterval(stopSpin);
  1121. var z = -310;
  1122. transBack('holder',z);
  1123. deezPlay('holder',0);
  1124. deezPlay('wrapper',0);
  1125. setTimeout(itsOver('Sorry Wrong Code!'),02222);
  1126.  
  1127. }
  1128. }
  1129. }
  1130.  
  1131.  
  1132.  
  1133.  
  1134. function Dstruct(){
  1135.  
  1136. keyPad(1);
  1137. stopDerbis = setInterval(derbis,00001);
  1138.  
  1139. function derbis(){
  1140. widHeight = widHeight - 1;
  1141.  
  1142. if(widHeight <= 0){clearInterval(derbis);clearInterval(stopSpin);var b = -310;transBack('holder',b);finalReport();}
  1143.  
  1144. var f = 1;
  1145.  
  1146. for(i = 0;i < d.length;i = i + 2){
  1147.  
  1148. var n = 'fraame' + f;
  1149.  
  1150. var x = p[i];
  1151. var y = p[i+1];
  1152.  
  1153.  
  1154. setProperty(n,'width',widHeight+'px');
  1155. setProperty(n,'height',widHeight+'px');
  1156. setProperty('cont','width',widHeight+'px');
  1157. setProperty('cont','height',widHeight+'px');
  1158. setProperty('holder','width',widHeight+'px');
  1159. setProperty('holder','height',widHeight+'px');
  1160.  
  1161.  
  1162.  
  1163. var r = 'matrix(1,0,0,1,'+x+','+y+')';
  1164. styleTransform(n,r);
  1165. p[i] = p[i] + d[i];
  1166. p[i+1] = p[i+1] + d[i+1];
  1167.  
  1168. var f = f + 1;
  1169. }
  1170. }
  1171. }
  1172.  
  1173.  
  1174.  
  1175. function finalReport(){
  1176.  
  1177. var reward = topScore();
  1178. postStats('points',reward);
  1179.  
  1180.  
  1181.  
  1182. deezPlay('starter2',1);
  1183. deezPlay('controls',0);
  1184. deezPlay('spaceShip',0);
  1185. deezPlay('epitaph',1);
  1186. deezPlay('closer',1);
  1187. deezPlay('wrapper',0);
  1188.  
  1189. }
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200. /* ----<< CHANGE DIR >>----- */
  1201.  
  1202. function changeDir(DIR) {
  1203.  
  1204. switch(DIR){
  1205.  
  1206. case 1:
  1207. setProperty('steerL','background-color','#DDD');
  1208. setProperty('steerR','background-color','lime');
  1209. break;
  1210.  
  1211. case -1:
  1212. setProperty('steerR','background-color','#DDD');
  1213. setProperty('steerL','background-color','lime');
  1214. break;
  1215.  
  1216. default:
  1217. setProperty('steerL','background-color','#DDD');
  1218. setProperty('steerR','background-color','#DDD');
  1219. break;
  1220. }
  1221.  
  1222.  
  1223.  
  1224. var rotation = 0;
  1225. shift = DIR;
  1226. if(shift == 0){
  1227. var m = 'matrix(1,0,0,1,'+shipX+',0) rotate('+ rotation +'deg)';
  1228. styleTransform('spaceShip',m);
  1229. }
  1230.  
  1231. if((shipX >= 140) && (shift == -1) || (shipX <= -140) && (shift == 1)){shipX = shipX + shift;}
  1232.  
  1233. }
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246. /* ----<< EXPLODE >>----- */
  1247.  
  1248. function explode(){
  1249.  
  1250. deezPlay('hull',0);
  1251. deezPlay('explosion2',1);
  1252. setProperty('spaceShip','z-index','5');
  1253.  
  1254. clearInterval(stopCourse);
  1255. clearInterval(stopRoids);
  1256. clearInterval(stopSteer);
  1257. clearInterval(stopForceField);
  1258.  
  1259.  
  1260. for(n = 1; n < 17; n++ ){
  1261. var star = 'starz'+n;
  1262. deezPlay(star,0);
  1263. }
  1264.  
  1265. game = 'over';
  1266.  
  1267. itsOver('That Must Have Hurt!');
  1268. }
  1269.  
  1270.  
  1271.  
  1272.  
  1273. function itsOver(reason){
  1274.  
  1275. var top = localStorage.topScore;
  1276. starzTog(0);
  1277.  
  1278.  
  1279.  
  1280. var txt = '<h4>'+reason+'<\/h4><h1>GAME OVER!<\/h1><h2><span>YOUR SCORE:<\/span> <b>'+coinz+'<\/b><\/h2><h2>HIGH SCORE: <b>'+top+'<\/b><\/h2><h3>Play Again\?<\/h3><button onclick="window.location.reload(false);">ok<\/button>';
  1281.  
  1282.  
  1283. postStats('points',coinz);
  1284. postStats('lert',txt);
  1285. deezPlay('lert',1);
  1286. }
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292. /* ----<< FIELD ON >>----- */
  1293.  
  1294. function fieldON(){
  1295. function fieldOFF(){
  1296.  
  1297. if(lowFuel == 'low'){setProperty('fuelGage','background-color','fuchsia');setProperty('fuelGage','color','yellow');}
  1298. setProperty('corridor','border-color','transparent');
  1299. for(i = 0;i < 16;i++){
  1300. if(laserDisp[i] == 1){
  1301. setProperty('laser'+(i+1),'border-color','transparent');
  1302. }
  1303. }
  1304. forceField = 'off';
  1305. }
  1306.  
  1307.  
  1308. if(lowFuel == 'low'){setProperty('fuelGage','background-color','lime');setProperty('fuelGage','color','white');}
  1309. setProperty('corridor','border-color','orange');
  1310. for(i = 0;i < 16;i++){
  1311. if(laserDisp[i] == 1){
  1312. setProperty('laser'+(i+1),'border-color','orange');
  1313. }
  1314. }
  1315. forceField = 'on';
  1316. setTimeout(fieldOFF,03000);
  1317. }
  1318.  
  1319.  
  1320. /* ----<< FUEL PLENISH >>----- */
  1321.  
  1322. function fuelPlenish(){
  1323.  
  1324. var topOff = 100 - fuelLev;
  1325. var fuelUnitCost = gasFee / 100;
  1326. var fuelCost = fuelUnitCost * topOff;
  1327.  
  1328.  
  1329. if((coinz < fuelCost) && (coinz > fuelUnitCost)){
  1330. var gasAmt = parseInt(coinz / fuelUnitCost);
  1331. var spareChange = gasAmt * fuelUnitCost;
  1332. coinz = coinz - spareChange;
  1333. postStats('points',coinz);
  1334. }
  1335.  
  1336. if(coinz > fuelCost){
  1337. var gasAmt = topOff;
  1338. coinz = coinz - fuelCost;
  1339. postStats('points',coinz);
  1340. }
  1341.  
  1342. if(coinz < fuelUnitCost){var gasAmt = 0;}
  1343.  
  1344.  
  1345. fuelLev = fuelLev + gasAmt;
  1346.  
  1347. if(fuelLev > 100){fuelLev = 100;}
  1348.  
  1349.  
  1350. if(fuelLev > 41){lowFuel = 'full';setProperty('fuelGage','background-color','yellow');setProperty('fuelGage','color','red');}
  1351.  
  1352.  
  1353. var m = fuelLev + 'px';
  1354. setProperty('fuelLevel','width',m);
  1355. }
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362. /* ----<< POST STATS >>----- */
  1363.  
  1364. function postStats(ID,TEXT) {
  1365. document.getElementById(ID).innerHTML=TEXT;
  1366. }
  1367.  
  1368.  
  1369.  
  1370. /* ----<< RANDOMIZE >>----- */
  1371.  
  1372. function randomize(min, max){
  1373. return Math.floor(Math.random() * (max - min)) + min;
  1374. }
  1375.  
  1376.  
  1377.  
  1378.  
  1379. /* ----<< SCHNELL STATION >>----- */
  1380.  
  1381. function schnellStation(){
  1382. if(game != 'on'){clearInterval(sendStation);}
  1383. else{
  1384.  
  1385.  
  1386. function blinkBay() {
  1387. if(bay == false){setProperty('enter','fill','orange');}
  1388. else{setProperty('enter','fill','white');}
  1389. bay = !bay;
  1390. }
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396. function tractorBEAM(){
  1397. if(TBheight < 45){
  1398. TBheight++;
  1399. setProperty('tractorBeam','height',TBheight+'%');
  1400. }
  1401. else{
  1402. clearInterval(stopBeam);
  1403. stopRetract = setInterval(REtractor,40);
  1404. }
  1405. }
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411. function REtractor(){
  1412.  
  1413. if(TBheight > 0){
  1414.  
  1415.  
  1416. TBheight--;
  1417. setProperty('tractorBeam','height',TBheight+'%');
  1418.  
  1419. if(lockedON == true){
  1420. shift = 0;
  1421. rotation = 0;
  1422. var s = 'spaceShip';
  1423. var t = 'matrix(1,0,0,1,'+shipX+','+shipY+') rotate('+ rotation +'deg)';
  1424. styleTransform(s,t);
  1425. shipY = shipY - 7;
  1426. if((shipX > -120) && (shipX < -95)){shipX++;}
  1427. if((shipX < 41) && (shipX > 0)){shipX--;}
  1428. }
  1429.  
  1430.  
  1431.  
  1432.  
  1433. if((lockedON == true) && (TBheight < 10)){deezPlay('spaceShip',0);}
  1434.  
  1435.  
  1436. }
  1437.  
  1438. else{
  1439. clearInterval(stopRetract);
  1440. clearInterval(stopBlinking);
  1441. deezPlay('enter',0);
  1442. deezPlay('closed',1);
  1443. stopSend = setInterval(sendStation,10);
  1444.  
  1445. if(lockedON == true){fuelPlenish(100);}
  1446. else{
  1447. var Idex = stage - 1;
  1448. var newCombo = randomize(0,10);
  1449. destructCode[Idex] = newCombo;
  1450. stage++
  1451. }
  1452.  
  1453. shipY = 0;
  1454. }
  1455. }
  1456.  
  1457.  
  1458.  
  1459.  
  1460. function endStage(){
  1461.  
  1462.  
  1463. function payItForward()
  1464. {
  1465.  
  1466. clearInterval(stopSteer);
  1467. var Idex = stage - 1;
  1468. var newCombo = randomize(0,10);
  1469. destructCode[Idex] = newCombo;
  1470.  
  1471.  
  1472.  
  1473. var DeCode = destructCode.join(' ');
  1474.  
  1475. deezPlay('lert',1);
  1476. starzTog(0);
  1477.  
  1478.  
  1479. var flightLog = '<p>Congratulations\! You made it through stage '+stage+' of your '+finalStage+' stage preliminary mission before going on to destroy Lord Fulicer\'s Super Nova Palace with this destruct code\:<\/p><p id="combo"><mark>'+DeCode+'<\/mark><\/p>';
  1480.  
  1481. if(stage >= finalStage)
  1482. {
  1483. var flightLog = flightLog + '<p>Remember this Destruct Code! For now you must fly the last leg of your quest to save your Slalomite Race.';
  1484. }
  1485.  
  1486.  
  1487. if(coinz > 0)
  1488. {
  1489. var flightLog = flightLog + '<p>You have collected '+coinz+' dollars. You now have a very special bonus opportunity to pay something forward.<\/p><p>Do you want to be blessed ten fold \? Please enter the amount of your investment.<\/p><p><button onclick="keyPad(1);startGame()">skip<\/button><\/p>';keyPad(0);
  1490. }
  1491. else
  1492. {
  1493. var flightLog = flightLog + '<p><button onclick="startGame()">ok<\/button><\/p>';
  1494. }
  1495.  
  1496.  
  1497. postStats('lert',flightLog);
  1498. postStats('points',coinz);
  1499.  
  1500. deezPlay('spaceShip',0);
  1501.  
  1502. }
  1503.  
  1504.  
  1505. payItForward();
  1506. stage++;
  1507. postStats('points',coinz);
  1508. }
  1509.  
  1510.  
  1511. function startStation(){
  1512.  
  1513. deezPlay('enter',1);
  1514. deezPlay('closed',0);
  1515.  
  1516. stopBlinking = setInterval(blinkBay,0100);
  1517.  
  1518.  
  1519. if (stationY < (screenHeight / 2)){
  1520.  
  1521. var s = 'station';
  1522. var t = 'matrix(1,0,0,1,0,'+stationY+')';
  1523. styleTransform(s,t);
  1524. stationY = stationY + 2;
  1525.  
  1526. }
  1527. else {
  1528. clearInterval(stopStation);
  1529. deezPlay('tractorBeam',1);
  1530. stopBeam = setInterval(tractorBEAM,0040);
  1531. }
  1532. }
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538. function sendStation(){
  1539.  
  1540.  
  1541. if (stationY < (screenHeight + 140)){
  1542.  
  1543.  
  1544.  
  1545.  
  1546. if((stationY > (screenHeight - 140)) && (stationY < (screenHeight - 100)) && (shipX < 120) && (shipX > -115) && (lockedON == false)){clearInterval(stopSend);
  1547.  
  1548. explode();}
  1549.  
  1550. var s = 'station';
  1551. var t = 'matrix(1,0,0,1,0,'+stationY+')';
  1552. styleTransform(s,t);
  1553. stationY = stationY + 2;
  1554.  
  1555.  
  1556. }
  1557.  
  1558. else {
  1559. clearInterval(stopSend);
  1560. clearInterval(stopSteer);
  1561. var s = 'station';
  1562. var t = -stationY;
  1563.  
  1564. transBack(s,t);
  1565.  
  1566. if(lockedON == true){endStage();}
  1567. else{startGame();}
  1568.  
  1569.  
  1570. shift = 0;
  1571. rotation = 0;
  1572. shipX = 0;
  1573. var s = 'spaceShip';
  1574. var y = -shipY;
  1575.  
  1576. var m = 'matrix(1,0,0,1,'+shipX+','+y+') rotate('+rotation+'deg)';
  1577. styleTransform(s,m);
  1578.  
  1579.  
  1580. stationY = 0;
  1581. shipY = 0;
  1582. deadCenter = 155;
  1583. lockedON = false;
  1584. }
  1585.  
  1586.  
  1587. }
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596. function finale(){
  1597. clearInterval(stopSteer);
  1598. function spinWheel(){
  1599. var r = 'matrix(1,0,0,1,0,'+novaY+')rotate('+turn+'deg)';
  1600. styleTransform('holder',r);
  1601.  
  1602. if(turn < 360){turn = turn + 3;}
  1603. else{turn = 0;}
  1604.  
  1605. if(novaY < 180){novaY++;}
  1606. else{
  1607.  
  1608. deezPlay('keypad',1);
  1609. document.getElementById('okay').removeEventListener('click',payForward);
  1610. document.getElementById('okay').addEventListener('click',matchEntry);
  1611.  
  1612. setTimeout(keyPad(0),02222);
  1613.  
  1614. }
  1615. }
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633. function enterCode(){
  1634. clearCode();
  1635. codeSelect('Enter Destruction Code!');
  1636.  
  1637. var Dc = destructCode.toString();
  1638. Dcode = Dc.replace(/,/g, '');
  1639. }
  1640.  
  1641.  
  1642.  
  1643. stopSpin = setInterval(spinWheel,003);
  1644.  
  1645. enterCode();
  1646.  
  1647. }
  1648.  
  1649.  
  1650.  
  1651.  
  1652. clearInterval(stopRoids);
  1653.  
  1654. if(stage >= (finalStage+1)){
  1655. deezPlay('holder',1);
  1656. finale();
  1657. }
  1658. else {
  1659. deezPlay('station',1);
  1660. stopStation = setInterval(startStation,0010);
  1661.  
  1662. }
  1663. }
  1664. }
  1665.  
  1666.  
  1667.  
  1668. function keyPad(tog){
  1669.  
  1670. if(tog == 0){var C = 0;var S = 0;var W = 1;}
  1671. else{var C = 1;var S = 1;var W = 0;}
  1672. deezPlay('controls',C);
  1673. deezPlay('spaceShip',S);
  1674. deezPlay('wrapper',W);
  1675. }
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681. /* [ 08 ] ----<< SET PROPERTY >>----- */
  1682.  
  1683. function setProperty(ID,ATT,VAL) {
  1684. document.getElementById(ID).style.setProperty(ATT,VAL);
  1685. }
  1686.  
  1687.  
  1688. /* ----<< deezPlay >>----- */
  1689.  
  1690. function deezPlay(ID,TOG) {
  1691. if(TOG == 0){var VAL = 'none';}
  1692. else{var VAL = 'block';}
  1693.  
  1694. document.getElementById(ID).style.setProperty('display',VAL);
  1695. }
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703. /* ----<< START COURSE >>----- */
  1704.  
  1705. function startCourse(){
  1706.  
  1707.  
  1708. function createRoid(){
  1709. var availRoids = new Array();
  1710.  
  1711. for(i = 0;i < 8;i++){
  1712. if(roidDisp[i] == 0){ availRoids.push(i); }
  1713. }
  1714.  
  1715. if(availRoids.length < 1){return;}
  1716.  
  1717. var randIndex = randomize(0,availRoids.length);
  1718. var randomColor = randomize(0,8);
  1719. var indNum = availRoids[randIndex];
  1720.  
  1721. roidDisp[indNum] = 1;
  1722. var r = 'roid' + (indNum + 1);
  1723. deezPlay(r,1);
  1724. setProperty(r,'fill',roidColor[randomColor]);
  1725. setProperty(r,'stroke',roidColor[randomColor]);
  1726. }
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735. function laser(side,maxLength){
  1736.  
  1737. if(side == 'L'){var m = 0;}
  1738. if(side == 'R'){var m = 8;}
  1739.  
  1740. var availLasers = new Array();
  1741.  
  1742. for(i = (0 + m);i < (8 + m);i++){
  1743. if(laserDisp[i] == 0){ availLasers.push(i); }
  1744. }
  1745. if(availLasers.length < 1){return;}
  1746.  
  1747. var randIndex = randomize(0,availLasers.length);
  1748. var indNum = availLasers[randIndex];
  1749.  
  1750. var l = 'laser' + (indNum + 1);
  1751.  
  1752. var laserLength = randomize(60,maxLength);
  1753. if(side == 'L'){var laserEnd = laserLength - 20;}
  1754. if(side == 'R'){var laserEnd = 310 - laserLength;}
  1755.  
  1756. laserDisp[indNum] = 1;
  1757. laserX[indNum] = laserEnd;
  1758.  
  1759. deezPlay(l,1);
  1760. setProperty(l,'width',laserLength+'px');
  1761. }
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769. function Lasers(){
  1770. laser('L',120);
  1771. laser('R',120);
  1772. }
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778. function createCoin() {
  1779.  
  1780. var availCoins = new Array();
  1781.  
  1782. for(i = 0;i < 3;i++){
  1783. if(coinDisp[i] == 0){ availCoins.push(i); }
  1784. }
  1785.  
  1786. if(availCoins.length < 1){return;}
  1787.  
  1788. var randIndex = randomize(0,availCoins.length);
  1789. var indNum = availCoins[randIndex];
  1790.  
  1791. coinDisp[indNum] = 1;
  1792. var c = 'coin' + (indNum + 1);
  1793. deezPlay(c,1);
  1794. }
  1795.  
  1796.  
  1797. if (cyclez < numCyclez){
  1798.  
  1799. var m = fuelLev + 'px';
  1800. setProperty('fuelLevel','width',m);
  1801.  
  1802. var RCL = randomize(0,15);
  1803.  
  1804.  
  1805.  
  1806. var RCL = randomize(0,15);
  1807.  
  1808. switch (RCL){
  1809.  
  1810. case 0:
  1811. createRoid();
  1812.  
  1813. break;
  1814.  
  1815. case 1:
  1816. Lasers();
  1817. break;
  1818.  
  1819. case 2:
  1820. createCoin();
  1821. createRoid();
  1822. break;
  1823.  
  1824. case 3:
  1825. laser('L',180);
  1826. break;
  1827.  
  1828.  
  1829. case 4:
  1830. laser('R',180);
  1831. break;
  1832.  
  1833.  
  1834. case 5:
  1835. laser('L',180);
  1836. break;
  1837.  
  1838.  
  1839. case 6:
  1840. Lasers();
  1841. break;
  1842.  
  1843.  
  1844. case 7:
  1845. createRoid();
  1846. createRoid();
  1847. break;
  1848.  
  1849. case 8:
  1850. laser('R',180);
  1851. break;
  1852.  
  1853. case 9:
  1854. createRoid();
  1855. break;
  1856.  
  1857. case 10:
  1858. laser('R',180);
  1859. break;
  1860.  
  1861.  
  1862. case 11:
  1863. createRoid();
  1864. break;
  1865.  
  1866. case 12:
  1867. createCoin();
  1868. createRoid();
  1869. break;
  1870.  
  1871. case 13:
  1872. laser('L',180);
  1873. break;
  1874.  
  1875. case 14:
  1876. createCoin();
  1877. break;
  1878.  
  1879.  
  1880. default:
  1881. createCoin();
  1882. }
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891. milez++;
  1892. cyclez++;
  1893.  
  1894. if (fuelLev < 40){lowFuel = 'low';}
  1895.  
  1896.  
  1897. if (fuelLev > 0){fuelLev--;}
  1898. else{
  1899. clearInterval(stopCourse);
  1900. clearInterval(stopRoids);
  1901. clearInterval(stopSteer);
  1902. clearInterval(stopForceField);
  1903. itsOver('You Ran Out Of Fuel!');
  1904.  
  1905. }
  1906.  
  1907.  
  1908. }
  1909. else{
  1910. clearInterval(stopForceField);
  1911. clearInterval(stopCourse);
  1912. setTimeout(schnellStation,4200);
  1913.  
  1914. cyclez = 1;
  1915. }
  1916. }
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931. /* ----<< START ROIDS >>----- */
  1932.  
  1933. function startRoids() {
  1934.  
  1935. var T = screenHeight - 190;
  1936. var B = screenHeight - 165;
  1937. var R = deadCenter + 4;
  1938. var L = deadCenter - 38;
  1939.  
  1940. for(num = 1; num < 9;num++){
  1941. var r = 'roid' + num;
  1942. var c = 'coin' + num;
  1943.  
  1944. var i = num - 1;
  1945.  
  1946. if(roidDisp[i] == 1){
  1947. var b = 'matrix(1,0,0,1,0,'+roidTrans[i]+') rotate('+roidRot[i]+'deg)';
  1948. styleTransform(r,b);
  1949. roidTrans[i]++;
  1950. roidRot[i] = roidRot[i] + roidRotDir[i];
  1951. }
  1952.  
  1953.  
  1954. if(roidTrans[i] > travel)
  1955. {
  1956. roidDisp[i] = 0;
  1957. transBack(r,-roidTrans[i]);
  1958. roidTrans[i] = 0;
  1959. var r = randomize(-2,2);
  1960. roidRotDir[i] = r;
  1961. }
  1962.  
  1963. if((roidTrans[i] > T) && (roidTrans[i] < B) && (roidX[i] < R) && (roidX[i] > L)){explode();}
  1964.  
  1965.  
  1966. if(coinDisp[i] == 1){
  1967. var b = 'matrix(1,0,0,1,0,'+coinTrans[i]+') rotate('+coinSpin+'deg)';
  1968. styleTransform(c,b);
  1969. coinTrans[i]++;
  1970. if(coinSpin > 360){coinSpin = 0;}
  1971. else{coinSpin++;}
  1972. }
  1973.  
  1974.  
  1975.  
  1976. if(coinTrans[i] > travel)
  1977. {
  1978. coinDisp[i] = 0;
  1979. transBack(c,-coinTrans[i]);
  1980. coinTrans[i] = 0;
  1981. }
  1982.  
  1983.  
  1984. if((coinTrans[i] > T) && (coinTrans[i] < B) && (coinX[i] < R) && (coinX[i] > L))
  1985. {
  1986. coinDisp[i] = 0;
  1987. transBack(c,-coinTrans[i]);
  1988. coinTrans[i] = 0;
  1989. coinz = coinz + coinValue;
  1990. postStats('points',coinz);
  1991. }
  1992.  
  1993. for(t = 0;t < 9;t = t + 8){
  1994. var ind = t + i;
  1995. var l = 'laser' + (ind + 1);
  1996.  
  1997. if(laserDisp[ind] == 1){
  1998. var b = 'matrix(1,0,0,1,0,'+laserTrans[ind]+')';
  1999. styleTransform(l,b);
  2000. laserTrans[ind]++;
  2001. }
  2002.  
  2003. if(laserTrans[ind] > travel){
  2004. laserDisp[ind] = 0;
  2005. transBack(l,-laserTrans[ind]);
  2006. laserTrans[ind] = 0;
  2007. }
  2008.  
  2009. if ((laserTrans[ind] < B) && (laserTrans[ind] > T) && (forceField == 'on')){
  2010.  
  2011. if((t < 8) && (laserX[ind] > L)){explode();}
  2012. if((t > 7) && (laserX[ind] < R)){explode();}
  2013.  
  2014. }
  2015. }
  2016. }
  2017. }
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024. /* ----<< STEER SHIP >>----- */
  2025.  
  2026.  
  2027.  
  2028. function steerShip(){
  2029. var shipsHere = Math.abs(shipX);
  2030.  
  2031. if((forceField == 'on') && (shipsHere > 139)){explode();}
  2032.  
  2033. if(TBheight > 35){
  2034.  
  2035. if ((shipX < 40) && (shipX > -120)){
  2036. lockedON = true;
  2037. clearInterval(stopSteer);
  2038. }
  2039. }
  2040.  
  2041. if((shift != 0) && (shipsHere <= 139)){
  2042. shipX = shipX + shift;
  2043.  
  2044. rotation = shift * 22;
  2045.  
  2046. deadCenter = deadCenter + shift;
  2047.  
  2048. var m = 'matrix(1,0,0,1,'+shipX+','+shipY+') rotate('+ rotation +'deg)';
  2049. styleTransform('spaceShip',m);
  2050. }
  2051. else{shift = 0;rotation = 0;
  2052. var m = 'matrix(1,0,0,1,'+shipX+',0) rotate('+ rotation +'deg)';
  2053. styleTransform('spaceShip',m);
  2054. }
  2055.  
  2056. }
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073. /* ----<< STYLE TRANSFORM >>----- */
  2074.  
  2075. function styleTransform(ID,TRANS){
  2076. document.getElementById(ID).style.transform=TRANS;
  2077. }
  2078.  
  2079.  
  2080.  
  2081.  
  2082. /* ----<< TOP SCORE >>----- */
  2083.  
  2084. function topScore() {
  2085. var legacy = coinz + (nestEgg * 10);
  2086. var top = localStorage.topScore;
  2087. if (legacy > top) {localStorage.topScore = legacy;}
  2088. return legacy;
  2089. }
  2090.  
  2091.  
  2092.  
  2093. /* ----<< TRANS BACK >>----- */
  2094.  
  2095. function transBack(ID,TRANS){
  2096.  
  2097. setProperty(ID,'display','none');
  2098. var t = 'matrix(1,0,0,1,0,'+TRANS+')';
  2099. styleTransform(ID,t);
  2100. }
  2101.  
  2102. </script>
  2103.  
  2104.  
  2105.  
  2106. </head>
  2107. <body>
  2108.  
  2109. <div id="space">
  2110.  
  2111. <div id="corridor">
  2112. <button id="starter1" onclick="staart()">START GAME</button>
  2113. <button id="starter2" onclick="window.location.reload(false);">START OVER</button>
  2114.  
  2115. <div id="prologue">
  2116. <div id="opener">
  2117. <div>
  2118. <p>You are the elite most space pilot of the Slalomites. You have been chosen to solo a mission of supreme importance to your race's survival. Having but one life to give for your Vagabond race of space denizens their lives depend solely on you.</p>
  2119. <p>You must travel through the treacherous space corridor and recover space dollars that the evil Lord Fulicer has stolen and scattered along the narrow passageway that leads to his Super Nova palace on the far outskirts of the uncharted universe.</p>
  2120. <p>Your mission involves <script>document.write(finalStage);</script> stages of intense coin collecting and asteroid avoiding. At the end of each, there will be a 'Schnell Station'. Fly into its tractor beam to dock. A digit of the destruct code to Lord Fulicer's Palace will be revealed to you. You will then be given the opportunity to increase your riches tenfold. If you're unable to dock, be sure to steer clear of the station's flight path. You need to maintain at least <script>document.write(gasFee);</script> space dollars in your account for full refueling costs. Otherwise you will only get a percentage of what space dollars you have.
  2121. </p>
  2122. <p>
  2123. To navigate your ship, mouse over the direction controls. To collect a coin, fly into its path, while still being cautious of the pulsating force field around you. Your adventurous mission starts... NOW!
  2124. </p>
  2125.  
  2126. </div>
  2127. </div>
  2128. </div>
  2129.  
  2130. <div id="epitaph">
  2131. <div id="closer">
  2132. <div>
  2133. <p>Congratulations on destroying Lord Fulicer's celestial empire. Not only have you restored peace for your people but you have earned them a whole bunch of space dollars to boot. You should be proud for ridding the world of such a tyrant and earning these much needed funds.</p>
  2134. <p>Only you could have pulled this thing off. You were simply amazing. You risked your life bobbing and weaving through all of that space derbis to bring home the extra terestrial bacon.</p>
  2135. <p>It is an honor to know you and to work with you. We just can't say enough about your instinctive space piloting skills. The way you handled yourself out there in deep space, when others would just fall to pieces, is why we have personally chosen you to go back out there and do it all over again.</p>
  2136. <p>Just press that start over button &mdash; you glory hound of a Slalomite you &mdash; and show us what you're really made of!</p>
  2137.  
  2138. </div>
  2139. </div>
  2140. </div>
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149. <div id="tractorBeam">&nbsp;</div>
  2150.  
  2151.  
  2152. <svg id="station" width="232.5" height="162.5" viewBox="0 0 232.5 162.5">
  2153.  
  2154. <defs>
  2155. <linearGradient id="grad2" x1="0%" y1="0%" x2="0%" y2="100%">
  2156. <stop offset="0%" style="stop-color:rgb(255,0,0);stop-opacity:1)" />
  2157. <stop offset="100%" style="stop-color:rgb(255,255,0);stop-opacity:1)" />
  2158. </linearGradient>
  2159. </defs>
  2160. <polyline stroke="lime" stroke-width=".8" fill="url(#grad2)" points="142.5,110 142.5,142.5 5,142.5 6,128.75 8,115 11,102.5 15,90 21.25,77.5 28.75,65 36,55 45,45 55,36 65,29 77.5,21.25 90,15 96.25,12.5
  2161. 115,8 128.75,6 142.5,6 159.5,8 172,11.5 181,15 190.4,20.45 202,29.73 212,42.1 221,57.54 226,73 227.5,90 226.55,100.5 223.7,110 218,119.6 212.22,127.22 204.6,133 195,138.7 185.5,141.54 175,142.5 168.5,141.9 162.6,140.1 156.7,136.6 153,133 148.4,128.13 145.5,122.4 143.1,112.6 142.5,110 144,102.5 148,96 155,91.5 162.5,90 167.25,91 171,94 174,97.75 175,102.5 172.75,107 167.5,109.5 165,108.5 162.5,105"></polyline>
  2162.  
  2163. <polyline id="dock" points="5,142.5 5,162.5 143.5,162.5 143.5,142.5 5,142.5 5,162.5"></polyline>
  2164.  
  2165. <text fill="purple" font-size="26" font-family="Serif" x="60" y="60">
  2166. WELCOME!</text>
  2167. <text fill="pink" font-size="20" font-family="Verdana" x="90" y="100">
  2168. to</text>
  2169. <text fill="fuchsia" font-size="22" font-family="Cursive" x="10" y="135">
  2170. SCHNELL's</text>
  2171.  
  2172. <text id="enter" x="12" y="156">ENTER HERE</text>
  2173. <text id="closed" x="12" y="156">STEER CLEAR</text>
  2174.  
  2175.  
  2176. </svg>
  2177.  
  2178.  
  2179.  
  2180.  
  2181. <svg id="spaceShip" width="25" height="35" viewBox="0 0 25 35">
  2182.  
  2183. <defs>
  2184.  
  2185. <pattern id="hull" width="25" height="35" patternUnits="userSpaceOnUse">
  2186. <g>
  2187. <polyline stroke="#000" stroke-width=".3" fill="lime" points="12.5,1 14,2 16,4 16.5,5 17,6 17,13 23,18 23.5,18.5 24,19.5 24,29 17,24 17,6 17,24 8,24 1,29 1,19.5 1.5,18.5 2,18 8,13 8,24 8,6 8.5,5 9,4 11,2 12.5,1"></polyline>
  2188.  
  2189.  
  2190. <polyline stroke="#444" stroke-width=".3" fill="#999" points="
  2191. 14.5,24 17,28 8,28 10.5,24"></polyline>
  2192.  
  2193.  
  2194. <polyline stroke="#111" stroke-width=".3" fill="#CCC" points="12.5,4.5 14.5,5 15.5,7 15.5,8 9.5,8 9.5,7 10.5,5 12.5,4.5"></polyline>
  2195.  
  2196. <polyline stroke="#000" stroke-width=".5" fill="lime" points="13.5,24.5 13,16 12.5,15.5 11,16 11.5,24.5 10.5,24.5 12.5,25 13.5,24.5"></polyline>
  2197.  
  2198. <polyline id="thruster" points="9.5,28 12.5,34.5 15.5,28"></polyline>
  2199.  
  2200. </g>
  2201. </pattern>
  2202.  
  2203.  
  2204. <pattern id="explosion2" width="25" height="35" patternUnits="userSpaceOnUse">
  2205. <g>
  2206.  
  2207. <polyline stroke="red" stroke-width="2" fill="yellow" points="3,4 8,8 13,1 15,9 22,6 20,10 23,12 18,17 24,23 17,24 20,31 14,26 12,34 8,27 3,30 6,23 2,22 6,18 2,13 6,13 3,4 8,8 "></polyline>
  2208.  
  2209.  
  2210. <polyline id="dock" points="10,12 12,16 16,12 14,16 16,19 13,23 15,26 13,22 9,25 8.5,21 11,19 9,17 11,14 10,12 "></polyline>
  2211.  
  2212. </g>
  2213. </pattern>
  2214.  
  2215.  
  2216.  
  2217. </defs>
  2218. <rect x="0" y="0" width="25" height="35" stroke-width="0" fill="url(#hull)" />
  2219.  
  2220. <rect x="0" y="0" width="25" height="35" stroke-width="0" fill="url(#explosion2)" />
  2221.  
  2222.  
  2223. </svg>
  2224.  
  2225.  
  2226.  
  2227.  
  2228. <script>
  2229.  
  2230. for(n = 1;n < 17;n++){
  2231. document.write('<hr class="laser" id="laser'+n+'">');
  2232.  
  2233.  
  2234.  
  2235. }
  2236.  
  2237.  
  2238.  
  2239. for(i = 1;i < 9;i++){
  2240.  
  2241. document.write('<span id="starz'+i+'">.<\/span>');
  2242. document.write('<span id="starz'+(i + 8)+'">.<\/span>');
  2243.  
  2244. document.write('<svg class="roids" id="roid'+i+'" width="25" height="25" viewBox="0 0 25 25"><polyline points="'+roidPoints[i - 1]+'"><\/polyline><\/svg>');
  2245. }
  2246.  
  2247.  
  2248. for(i = 1;i < 4;i++){
  2249.  
  2250. document.write('<svg class="coins" id="coin'+i+'" width="25" height="25" viewBox="0 0 25 25"><defs>');
  2251. document.write('<pattern id="koin'+i+'" width="25" height="35" patternUnits="userSpaceOnUse"><g>');
  2252. document.write('<circle cx="12.5" cy="12.5" r="12.5" stroke-width=".3" stroke="#EB8" fill="#C5B358" \/>');
  2253. document.write('<polyline stroke="\#996515" stroke-width="2" points="10,2 10,23"><\/polyline>');
  2254. document.write('<polyline stroke="\#996515" stroke-width="2" points="15,2 15,23"><\/polyline>');
  2255. document.write('<polyline stroke="\#996515" fill="transparent" stroke-width="2" points="19,8 15,4.5 12.5,4 10,4.5 6,6 5,8.5 6,11 10,12 12.5,12.5 14,12 18,14 19,16.5 18,19 15,20.5 12.5,21 10,20.5 5,17"><\/polyline>');
  2256. document.write('<\/g><\/pattern><\/defs>');
  2257. document.write('<circle cx="12.5" cy="12.5" r="12.5" stroke="transparent" stroke-width="0" fill="url(#koin'+i+')" \/><\/svg>');
  2258. }
  2259.  
  2260. </script>
  2261.  
  2262.  
  2263. <div id="holder">
  2264. <div id="cont">
  2265. <script>
  2266. for(t = 1;t < 6;t++){
  2267. document.write('<div class="fraame" id="fraame'+t+'"><\/div>');
  2268. }
  2269. </script>
  2270. </div>
  2271. </div>
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278. <div id="stats">
  2279. <div id="points"></div>
  2280.  
  2281. <div id="fuelGage"><span>&nbsp;</span><hr id="fuelLevel"></div>
  2282. </div>
  2283.  
  2284. <div id="controls">
  2285.  
  2286. <div class="ext" ontouchend="changeDir(0)" ontouchstart="changeDir(-1)">
  2287. <div class="steer" id="steerL" ontouchend="changeDir(0)" ontouchstart="changeDir(-1)">&laquo;</div>
  2288. </div>
  2289.  
  2290.  
  2291. <div class="ext" ontouchend="changeDir(0)" ontouchstart="changeDir(1)">
  2292. <div class="steer" id="steerR" ontouchend="changeDir(0)" ontouchstart="changeDir(1)">&raquo;</div>
  2293. </div>
  2294.  
  2295.  
  2296. </div>
  2297.  
  2298.  
  2299.  
  2300. <div id="lert"></div>
  2301.  
  2302.  
  2303.  
  2304.  
  2305. <div id="wrapper">
  2306. <div id="box">
  2307.  
  2308.  
  2309. <div id="lcd"><input type="text" readonly size="18" id="readOut">
  2310.  
  2311. </div>
  2312.  
  2313. <div id="keypad">
  2314. <script>
  2315.  
  2316.  
  2317.  
  2318. var stylez = ' nums"';
  2319. var keys = new Array ('7','8','9','4','5','6','1','2','3','0','ok','C');
  2320.  
  2321. for(n = 0;n < 4;n++){
  2322. document.write('<p>');
  2323. for(t = 0;t < 3;t++){
  2324. var i = (n * 3) + t;
  2325.  
  2326. var js = 'onclick="codeSelect(\''+keys[i]+'\')"';
  2327.  
  2328. if(i > 9){var stylez = '" id="okay"';var js = '';}
  2329. if(i > 10){var stylez = '" id="clearall"';var js = 'onclick="clearCode()"';}
  2330.  
  2331. document.write('<input type="button" class="buttn'+stylez+' value="'+keys[i]+'" '+js+'>');
  2332.  
  2333. }
  2334. document.write('<\/p>');
  2335. }
  2336. document.getElementById('okay').addEventListener('click',payForward);
  2337. codeSelect('Are You Paying Forward?');
  2338. </script>
  2339.  
  2340. </div>
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347. </div>
  2348.  
  2349. </div>
  2350.  
  2351. </div>
  2352.  
  2353. </div>
  2354.  
  2355. </body>
  2356. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement