Day8--------Easymaze

Source: Internet
Author: User

//----------Use the previous mouse tail star to complete the maze game, players need to continue to move to find the exit, but the body can not touch the wall, otherwise the game failed
----unfinished------did not complete the whole game, only to do the basic game mechanism, feel nothing interesting, and so when there is a good idea, then finish it
1<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">234<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>5<title>easyMaze</title>67<style type= "Text/css" >8 div{width:5px;height:5px;position:absolute;background:red;left:100px;top:100px;}9</style>Ten<script type= "Text/javascript" > OneWindow.onload=function(){ A for(i=0;i<8;i++) document.body.innerhtml+=Document.body.innerHTML; -Odiv=document.getelementsbytagname (' div '); - for(i=31;i<odiv.length;i++){ the if(i%2) odiv[i].style.top=odiv[i].offsettop+60+ ' px '; -Odiv[i].style.left=odiv[i].offsetleft+math.ceil (I/2) *5+ ' px '; -Odiv[i].onmouseover=function() {alert (' Game over. '));}; - } +Document.onmousemove=function(EV) { -oevent=ev| |event; + for(i=0;i<31;i++){ Aodiv[i].style.left=odiv[i+1].offsetleft+ ' px '; atodiv[i].style.top=odiv[i+1].offsettop+ ' px '; - } -odiv[30].style.left=oevent.clientx+ ' px '; -odiv[30].style.top=oevent.clienty+ ' px '; - } - } in</script> -<body> to<div></div> +</body> -

Day8--------Easymaze

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.