--- /dev/null
+// Google Street View Gun (GSVG) 0.3 Javascript
+// Created by Brian Flowers
+//
+// javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/shootview/shootview.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); }
+// M9 Gunshot sound effect from: http://soundbible.com/1906-Barreta-M9.html
+
+var svXscale = 1;
+var svYscale = 1;
+var hitNum = 0;
+var selectedGun = "m9";
+
+function run()
+{
+ document.body.style.cursor = "none";
+
+ var overlay = document.createElement("img");
+ overlay.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/crosshair.png");
+ overlay.setAttribute("id", "crosshair");
+ overlay.style.width = "50px";
+ overlay.style.height = "50px";
+ overlay.style.position = "absolute";
+ overlay.style.left = "100px";
+ overlay.style.top = "100px";
+ overlay.style.zIndex = "1000";
+ overlay.onclick = fire;
+ document.body.appendChild(overlay);
+
+ var gunImage = document.createElement("img");
+ gunImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/gun.png");
+ gunImage.setAttribute("id", "gunImage");
+ gunImage.style.width = "400px";
+ gunImage.style.height = "300px";
+ gunImage.style.position = "absolute";
+ gunImage.style.right = "0px";
+ gunImage.style.bottom = "0px";
+ gunImage.style.zIndex = "1000";
+ document.body.appendChild(gunImage);
+
+ document.onmousemove = UpdateCrosshairPosition;
+
+ fire(null);
+ reFocus();
+}
+
+function UpdateCrosshairPosition(e)
+{
+ document.getElementById("crosshair").style.left = (e.pageX-25)+"px";
+ document.getElementById("crosshair").style.top = (e.pageY-25)+"px";
+
+ var gunImage = document.getElementById("gunImage");
+
+ xDist = (window.innerWidth - parseInt(gunImage.style.width)) - e.pageX;
+ svXscale = xDist*2 / window.innerWidth;
+
+ yDist = window.innerHeight - e.pageY;
+ svYscale = yDist / window.innerHeight;
+
+ gunImage.style.width = (150+250*svXscale)+"px";
+ gunImage.style.bottom = (-100+100*svYscale)+"px";
+}
+
+function drawMuzzleFlash()
+{
+ var flash = document.createElement("img");
+ flash.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/muzzleFlash.png");
+ flash.setAttribute("id", "muzzleFlash");
+
+ if(svXscale < 0)
+ svXscale = 0.01;
+
+ flash.style.width = (800*(svXscale/2))+"px";
+ flash.style.height = (200)+"px";
+ flash.style.position = "absolute";
+ flash.style.right = ((150+225*svXscale)-(400*(svXscale/2)))+"px";
+ flash.style.bottom = ((75+100*svYscale))+"px";
+ flash.style.zIndex = "900";
+ document.body.appendChild(flash);
+ setTimeout("remove('muzzleFlash');", 25);
+}
+
+function fire(e)
+{
+ var hitDiv = document.createElement("div")
+ var hitDivId = "hitDiv"+hitNum;
+ var hitImgId = "hitImg"+hitNum
+ hitNum++;
+ hitDiv.setAttribute("id", hitDivId);
+
+ var shotSound = document.createElement("embed");
+ shotSound.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/fire.mp3");
+ shotSound.setAttribute ("autostart", "true");
+ shotSound.setAttribute("id", "shotSound");
+ shotSound.setAttribute("enablejavascript", "true");
+ hitDiv.appendChild(shotSound);
+
+ var hitImage = document.createElement("img");
+ hitImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/hit.gif");
+ hitImage.setAttribute("id", hitImgId);
+ hitImage.style.width = "15px";
+ hitImage.style.height = "15px";
+ hitImage.style.position = "absolute";
+ hitImage.style.top = (e.pageY-7)+"px";
+ hitImage.style.left = (e.pageX-10)+"px";
+ hitImage.style.zIndex = "1000";
+ hitDiv.appendChild(hitImage);
+ document.body.appendChild(hitDiv);
+ drawMuzzleFlash();
+ hitNum++;
+
+ setTimeout("remove('"+hitImgId+"')", 350);
+ setTimeout("remove('"+hitDivId+"')", 1000);
+
+ reFocus();
+}
+
+function reFocus()
+{
+ document.getElementById("panoflash1").focus()
+}
+
+function remove(id)
+{
+ element = document.getElementById(id);
+ element.parentNode.removeChild(element);
+}
+
+function stub()
+{}
+
+alert("GSVG will start in 5 seconds -- take this time to hide the maps side pane. And if you haven't selected your street view location yet, better hurry up!");
+setTimeout("run();", 5000);
\ No newline at end of file
--- /dev/null
+// Google Street View Gun (GSVG) 0.2 Javascript
+// Created by Brian Flowers
+//
+// javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/shootview/shootview.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); }
+// M9 Gunshot sound effect from: http://soundbible.com/1906-Barreta-M9.html
+
+var svXscale = 1;
+var svYscale = 1;
+var hitNum = 0;
+var selectedGun = "m9";
+
+function run()
+{
+ document.body.style.cursor = "none";
+
+ var overlay = document.createElement("img");
+ overlay.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/crosshair.png");
+ overlay.setAttribute("id", "crosshair");
+ overlay.style.width = "50px";
+ overlay.style.height = "50px";
+ overlay.style.position = "absolute";
+ overlay.style.left = "100px";
+ overlay.style.top = "100px";
+ overlay.style.zIndex = "1000";
+ overlay.onclick = fire;
+ document.body.appendChild(overlay);
+
+ var gunImage = document.createElement("img");
+ gunImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/gun.png");
+ gunImage.setAttribute("id", "gunImage");
+ gunImage.style.width = "400px";
+ gunImage.style.height = "300px";
+ gunImage.style.position = "absolute";
+ gunImage.style.right = "0px";
+ gunImage.style.bottom = "0px";
+ gunImage.style.zIndex = "1000";
+ document.body.appendChild(gunImage);
+
+ document.onmousemove = UpdateCrosshairPosition;
+
+ fire(null);
+ reFocus();
+}
+
+function UpdateCrosshairPosition(e)
+{
+ document.getElementById("crosshair").style.left = (e.pageX-25)+"px";
+ document.getElementById("crosshair").style.top = (e.pageY-25)+"px";
+
+ var gunImage = document.getElementById("gunImage");
+
+ xDist = (window.innerWidth - parseInt(gunImage.style.width)) - e.pageX;
+ svXscale = xDist*2 / window.innerWidth;
+
+ yDist = window.innerHeight - e.pageY;
+ svYscale = yDist / window.innerHeight;
+
+ gunImage.style.width = (150+250*svXscale)+"px";
+ gunImage.style.bottom = (-100+100*svYscale)+"px";
+}
+
+function drawMuzzleFlash()
+{
+ var flash = document.createElement("img");
+ flash.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/muzzleFlash.png");
+ flash.setAttribute("id", "muzzleFlash");
+ flash.style.width = (800*(svXscale/2))+"px";
+ flash.style.height = (200)+"px";
+ flash.style.position = "absolute";
+ flash.style.right = ((150+225*svXscale)-(400*(svXscale/2)))+"px";
+ flash.style.bottom = ((75+100*svYscale))+"px";
+ flash.style.zIndex = "900";
+ document.body.appendChild(flash);
+ setTimeout("remove('muzzleFlash');", 25);
+}
+
+function fire(e)
+{
+ var hitDiv = document.createElement("div")
+ var hitDivId = "hitDiv"+hitNum;
+ var hitImgId = "hitImg"+hitNum
+ hitNum++;
+ hitDiv.setAttribute("id", hitDivId);
+
+ var shotSound = document.createElement("embed");
+ shotSound.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/fire.mp3");
+ shotSound.setAttribute ("autostart", "true");
+ shotSound.setAttribute("id", "shotSound");
+ shotSound.setAttribute("enablejavascript", "true");
+ hitDiv.appendChild(shotSound);
+
+ var hitImage = document.createElement("img");
+ hitImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/hit.gif");
+ hitImage.setAttribute("id", hitImgId);
+ hitImage.style.width = "15px";
+ hitImage.style.height = "15px";
+ hitImage.style.position = "absolute";
+ hitImage.style.top = (e.pageY-7)+"px";
+ hitImage.style.left = (e.pageX-10)+"px";
+ hitImage.style.zIndex = "1000";
+ hitDiv.appendChild(hitImage);
+ document.body.appendChild(hitDiv);
+ drawMuzzleFlash();
+ hitNum++;
+
+ setTimeout("remove('"+hitImgId+"')", 350);
+ setTimeout("remove('"+hitDivId+"')", 1000);
+
+ reFocus();
+}
+
+function reFocus()
+{
+ document.getElementById("panoflash1").focus()
+}
+
+function remove(id)
+{
+ element = document.getElementById(id);
+ element.parentNode.removeChild(element);
+}
+
+function stub()
+{}
+
+//alert("GSVG will start in 5 seconds -- take this time to hide the maps side pane. And if you haven't selected your street view location yet, better hurry up!");
+//setTimeout("run();", 5000);
+run();
\ No newline at end of file
--- /dev/null
+<html>
+<head>
+ <title>Google Street View Gun (GSVG)</title>
+</head>
+
+<body>
+<h2>Google Street View Gun (GSVG) 0.3</h2>
+<p>This project is a reaction to Google's shutdown of <a href="http://www.businessinsider.com/google-shoot-view-shoot-em-up-game-killed-by-google-2011-12?op=1">Google Shoot View</a></p>
+<img src="preview.jpg" height="250px" />
+<p>
+To "install" Google Street view Gun, drag this link onto your Firefox bookmarks menu:<br/>
+<a href='javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/gsvg/gsvg.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); }'>GSVG</a>
+<br/>
+Then, open a google maps street view window, and click the bookmark!<br/><br/>
+<b>Controls:</b>
+<ul><li>Click to shoot</li>
+ <li>arrow up/down to move</li>
+ <li>WASD or left/right and page up/page down to look</li></ul>
+<b>Compatibility</b>
+<ul><li>This script has been tested on Mozilla Firefox 3.6 and later on Windows, Linux, and Mac.</li>
+ <li>Older browser versions (including FF 3.6) will likely be slow and "lag"</li>
+ <li><b>Audio requires a plugin: <a href="soundEmbed.html" style="font-size: smaller">test it here</a></b>
+ <ul><li>Windows: You probably already have it (Quicktime I think)</li>
+ <li>Linux users: mplayer, gstreamer, or any similar browser plugin media should do</li>
+ <li>Mac users: You're on your own. Quicktime maybe?</li></ul>
+ </ul>
+<b>Known bugs:</b><br/>
+<ul><li>You can shoot outside the maps window -- like the Google logo (arguably, this could be a 'feature', not a bug... :)</li>
+ <li>The graphics are ATROCIOUS and the animation is cheesy. (Any artists wanna help out? See below)</li>
+ <li>Gun image, muzzle flash are off if you aim far right (like government, GSVG fails at the extreme right!)</li></ul>
+
+<h3>Want to help out?</h3>
+<p>Right now I'm looking for artwork. Need to replace most of the existing pictures/animations with something better.
+Also looking to expand this to multiple guns -- will need new artwork and sounds for any of those. All work must be freely licensed (creative commons,
+public domain, etc.) Contact me if you have any suggestions or would like to help out: gsvg-admn@bsflowers.net<br/>
+Also, feel free to contact me with any bugs or issues!</p>
+
+<h3>Thanks to:</h3>
+<p>M9 sound effect from: <a href="http://soundbible.com/1906-Barreta-M9.html">SoundBible.com</a></p>
+
+<p align="center">
+<!-- Start of StatCounter Code for Default Guide -->
+<script type="text/javascript">
+var sc_project=7527168;
+var sc_invisible=0;
+var sc_security="f4ed8d93";
+</script>
+<script type="text/javascript"
+src="http://www.statcounter.com/counter/counter.js"></script>
+<noscript><div class="statcounter"><a title="tumblr
+counter" href="http://statcounter.com/tumblr/"
+target="_blank"><img class="statcounter"
+src="http://c.statcounter.com/7527168/0/f4ed8d93/0/"
+alt="tumblr counter"></a></div></noscript>
+<!-- End of StatCounter Code for Default Guide -->
+</p>
+</body>
\ No newline at end of file
--- /dev/null
+// Google Street View Gun (GSVG) 0.2 Javascript
+// Created by Brian Flowers
+//
+// javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/shootview/shootview.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); }
+// M9 Gunshot sound effect from: http://soundbible.com/1906-Barreta-M9.html
+
+var svXscale = 1;
+var svYscale = 1;
+var hitNum = 0;
+var selectedGun = "m9";
+
+function run()
+{
+ document.body.style.cursor = "none";
+
+ var overlay = document.createElement("img");
+ overlay.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/crosshair.png");
+ overlay.setAttribute("id", "crosshair");
+ overlay.style.width = "50px";
+ overlay.style.height = "50px";
+ overlay.style.position = "absolute";
+ overlay.style.left = "100px";
+ overlay.style.top = "100px";
+ overlay.style.zIndex = "1000";
+ overlay.onclick = fire;
+ document.body.appendChild(overlay);
+
+ var gunImage = document.createElement("img");
+ gunImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/gun.png");
+ gunImage.setAttribute("id", "gunImage");
+ gunImage.style.width = "400px";
+ gunImage.style.height = "300px";
+ gunImage.style.position = "absolute";
+ gunImage.style.right = "0px";
+ gunImage.style.bottom = "0px";
+ gunImage.style.zIndex = "1000";
+ document.body.appendChild(gunImage);
+
+ document.onmousemove = UpdateCrosshairPosition;
+
+ fire(null);
+ reFocus();
+}
+
+function UpdateCrosshairPosition(e)
+{
+ document.getElementById("crosshair").style.left = (e.pageX-25)+"px";
+ document.getElementById("crosshair").style.top = (e.pageY-25)+"px";
+
+ var gunImage = document.getElementById("gunImage");
+
+ xDist = (window.innerWidth - parseInt(gunImage.style.width)) - e.pageX;
+ svXscale = xDist*2 / window.innerWidth;
+
+ yDist = window.innerHeight - e.pageY;
+ svYscale = yDist / window.innerHeight;
+
+ gunImage.style.width = (150+250*svXscale)+"px";
+ gunImage.style.bottom = (-100+100*svYscale)+"px";
+}
+
+function fire(e)
+{
+ var hitDiv = document.createElement("div")
+ var hitDivId = "hitDiv"+hitNum;
+ var hitImgId = "hitImg"+hitNum
+ hitNum++;
+ hitDiv.setAttribute("id", hitDivId);
+
+ var shotSound = document.createElement("embed");
+ shotSound.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/fire.mp3");
+ shotSound.setAttribute ("autostart", "true");
+ shotSound.setAttribute("id", "shotSound");
+ shotSound.setAttribute("enablejavascript", "true");
+ hitDiv.appendChild(shotSound);
+
+ var hitImage = document.createElement("img");
+ hitImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/hit.gif");
+ hitImage.setAttribute("id", hitImgId);
+ hitImage.style.width = "15px";
+ hitImage.style.height = "15px";
+ hitImage.style.position = "absolute";
+ hitImage.style.top = (e.pageY-7)+"px";
+ hitImage.style.left = (e.pageX-10)+"px";
+ hitImage.style.zIndex = "1000";
+ hitDiv.appendChild(hitImage);
+ document.body.appendChild(hitDiv);
+ hitNum++;
+
+ setTimeout("remove('"+hitImgId+"')", 350);
+ setTimeout("remove('"+hitDivId+"')", 1000);
+
+ reFocus();
+}
+
+function reFocus()
+{
+ document.getElementById("panoflash1").focus()
+}
+
+function remove(id)
+{
+ element = document.getElementById(id);
+ element.parentNode.removeChild(element);
+}
+
+function stub()
+{}
+
+alert("GSVG will start in 5 seconds -- take this time to hide the maps side pane. And if you haven't selected your street view location yet, better hurry up!");
+setTimeout("run();", 5000);
\ No newline at end of file
--- /dev/null
+If the audio clip embedded below plays, sound in GSVG should work properly. If it shows a broken plugin, you'll need to fix that first.
+<embed src="guns/m9/fire.mp3" height="30px" width="300px" autostart="true" /><br/><br/>
+
+<a href="index.html">Back to GSVG</a>
\ No newline at end of file