Can you add more code to this space game!
At the moment the bare bones structure of a game is there using Jquery – But only just working….
- What can you add to make it more interesting?
- Add one new element and then upload and explain why. (like a scoring system or collision detection, maybe a shooting element….or graphics behind it all.
- Post it here and see how it develops into a game…….
- Examine what has been coded and the thought behind the next move
This is where your thoughts are important. Did you think it lacks in some area, try to improve it and return it!
Rules: – All on one page, and can upload to this site via a post, without adding any other files.
PASTE YOUR IMPROVED CODE BELOW THE GAME CODE
(after 500 lines I will move the css to an external file. As this can be quite a large file, and harder to navigate in code.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
<!DOCTYPE> <html> <head> <style> body { background-color: #000; color: #111111; } .info { top: 0; font-size: 40px; margin: 0; position: fixed; z-index: 1000; } h2, p { font-size: 40px; } p { font-size: 20px; } .bg1 { background-image:url(bg1.png); width:7000px; height:1000px; top: 0; left: 0; position:fixed; overflow-y: hidden; z-index:5; } .bg2 { background-image:url(bg2.png); width:7000px; height:1000px; top: 0; left: 0; position:fixed; overflow-y: hidden; z-index:10; } .bg3a { background-image:url(www.drax.neq3.com/cloud/rocket.png); width:280px; height:185px; top: 0; left: 0; position:fixed; overflow: hidden; z-index:15; } .footer { background:url(block.png) repeat; position: absolute; bottom:10px; height:204px; width:6000px; margin-top:400px; z-index:-5; } .rocket { position: fixed; top: 100px; margin-left: 100px; } .rightbutton { height: 50px; width: 160px; font-size: 28px; position: fixed; margin-top: 220px; z-index:95; margin-left: 240px; } .leftbutton { height: 50px; width: 160px; font-size: 28px; position: fixed; margin-top: 220px; z-index:90; } .upbutton { margin-top: 170px; margin-left: 120px; } .downbutton { margin-top: 270px; margin-left: 120px; } .buttons { margin-top: 220px; } </style> </head> <body> <img src="rocket.png" class="rocket"> <div class="bg1"></div> <div class="bg2"></div> <div class="bg3"></div> <div class="buttons"> <input type="button" value ="Left" class="leftbutton" id="leftbutton"> <input type="button" value ="Up" class="upbutton leftbutton" id="upbutton"> <input type="button" value ="Down" class="downbutton leftbutton" id="downbutton"> <input type="button" value ="Right" class="rightbutton" id="rightbutton"> </div> <div class="footer"></div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src='http://weblinc.github.io/jquery-parallax/jquery.parallax.js' type='text/javascript'></script> <script type="text/javascript"> $('.bg1').parallax({ speed: 0.2, axis: 'x' }); $('.bg2').parallax({ speed: 0.5, axis: 'x' }); $('.bg3').parallax({ speed: 1.2, axis: 'x' }); </script> <script> $(document).ready(function(){ $("#rightbutton").click(function() { $(".rocket").animate({ marginLeft: "+=900px", }, 1000 ); }); $("#leftbutton").click(function() { $(".rocket").animate({ marginLeft: "-=500px", }, 1000 ); }); $("#upbutton").click(function() { $(".rocket").animate({ marginTop: '-=150px' , opacity: 0.3 }, 1000 ); }); $("#downbutton").click(function() { $(".rocket").animate({ marginTop: '+=150px' , opacity: 1.0 }, 1000 ); }); }); </script> </body> </html> |