topical media & game development
student-wave-nm1-index.htm / htm
<html>
include(s)
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="student-wave-nm1-inc-style.css" />
<script type="text/javascript" src="student-wave-nm1-inc-js-jquery.js"></script>
dialog(s)
<script type="text/javascript">
document.ready(function(){
// Ask for users name (maby ask for color/etc later)
var username = prompt("Please enter your name:");
var mouseX = 0;
var mouseY = 0;
// Store the users mouse-position
$().mousemove(function(e){
mouseX = e.pageX;
mouseY = e.pageY;
});
notify server
// Notify the server of users mouse-position
var send = setInterval(function(e){
request positions
// Request all users mouse-positions (including the own!)
var recieve = setInterval(function(){
.getJSON(<student-wave-nm1-getPos.php>, function(data) {
/*$("#debug").html(data);*/
// For each of the users...
process user(s)
or create
} else {
// if we don't have a box for the user, create
// one with his name as id and append it to our
// document...
var box = $("<div id="+pos.name+" class=box>"
+pos.name+"</div>");
box.css('top',pos.y);
box.css('left',pos.x);
box.appendTo("body");
}
});
});
},300);
});
</script>
</head>
body / debug
<body>
<div id="debug"></div>
</body>
</html>
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.