moprpg/gameold.php

44 lines
775 B
PHP
Raw Normal View History

2017-10-22 18:15:11 -07:00
<?php
include("gui.php");
?>
<script type="text/javascript">
x=3
y=5
function newframe(x,y) {
2017-10-22 20:39:20 -07:00
document.all.TheFrame.src="showim.php?x=" + x + "&y=" + y
2017-10-22 18:15:11 -07:00
}
function go(d) {
// 1 for up, 2 for right, 3 for down, 4 for left
2017-10-22 20:39:20 -07:00
if(d==1) {
x=x
y=y-1
} else if(d==2) {
x=x+1
y=y
} else if(d==3) {
x=x
y=y+1
} else if(d==4) {
x=x-1
y=y
}
newframe(x,y)
2017-10-22 18:15:11 -07:00
}
</script>
<?php
2017-10-22 20:39:20 -07:00
$frame="<iframe id='TheFrame' src='showim.php?x=3&y=5' frameborder='0' width='470' height='329'></iframe>";
2017-10-22 18:15:11 -07:00
2017-10-22 20:39:20 -07:00
$links="<a href='javascript:go(1);'>Up</a> <br><a href='javascript:go(4);'>Left</a> <a href='javascript:go(2);'>Right</a><br>
2017-10-22 18:15:11 -07:00
<a href='javascript:go(3);'>Down</a>";
2017-10-22 20:39:20 -07:00
make_gui($frame, $links);
2017-10-22 18:15:11 -07:00
2017-10-22 20:39:20 -07:00
?>