第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

fruit的問(wèn)題,怎么這一節(jié)問(wèn)題這么少

var?fruitObject=function(){
this.alive=[];//boolean
this.orange=new?Image();
this.blue=new?Image();
this.x=[];
this.y=[];

}
fruitObject.prototype.num=30;
fruitObject.prototype.init=function()?{
	for(var?i=0;i<this.num;i++){
		this.alive[i]=true;
		this.x[i]=0;
		this.y[i]=0;
		this.born(i);
	}
	this.orange.src="./src/fruit.png";
	this.blue.src="./src/blue.png";
}
fruitObject.prototype.draw=function(){
	for(var?i=0;i<this.name;i++){
		ctx2.drawImage(this.orange,this.x[i],this.y[i]);

	}

}

fruitObject.prototype.born=function(i){
	var?aneid=Math.floor(Math.random()*ane.num);
	this.x[i]=ane.x[aneid];
	this.y[i]=canHeight-ane.length[aneid];
?

}


var?can1;
var?can2;

var?ctx1;
var?ctx2;

var?canWidth;
var?canHeight;

var?lastTime;
var?deltaTime;

var?ane;
var?fruit;

var?bgPic=new?Image();
document.body.onload=game;
function?game()
{
	init();
	lastTime=Date.now();
	deltaTime=0;
	gameloop();
	}
function?init(){
	//獲得canves?context
	can1=document.getElementById("canvas1");//fishes,dust,ui
	ctx1=can1.getContext('2d');
	can2=document.getElementById("canvas2");
	ctx2=can2.getContext('2d');

	bgPic.src="./src/background.jpg";

	canWidth=can1.width;
????canHeight=can1.height;

????ane=new?aneObject();
????ane.init();

????fruit=new?fruitObject();
????fruit.init();
}
function?gameloop(){
	requestAnimFrame(gameloop);
	var?now=Date.now();
	deltaTime=now-lastTime;
	lastTime=now;

	drawbackground();
	ane.draw();
	fruit.draw();

	
}

<!DOCTYPE?HTML>
<html>
<head>
	<meta?charset="utf-8">
	<title>愛(ài)心魚(yú)</title>
	<style?type="text/css">
	body{
		padding-top:?10px;
	}
	.all_bg{
		width:?800px;
		height:?600px;
		margin:?0px?auto;
	}
	.allCanves{
		position:?relative;;
		width:?800px;
		height:?600px;
		margin:?0px;
	}
	#canves1{
		position:?absolute;
		bottom:?0;
		left:?0;
		z-index:?1;

	}
	#canves2{
		position:?absolute;
		bottom:?0;
		left:?0;
		z-index:?0;
	}

	</style>


</head>
<body>
<div?class="all_bg">
	<div?id="allCanves">
		<canvas?id="canvas1"?width="800"?height="600"></canvas>
		<canvas?id="canvas2"?width="800"?height="600"></canvas>
		
	</div>
</div>
<script?type="text/javascript"?src="js/main.js"></script>
<script?type="text/javascript"?src="js/commonFunctions.js"></script>
<script?type="text/javascript"?src="js/background.js"></script>
<script?type="text/javascript"?src="js/ane.js"></script>
<script?type="text/javascript"?src="js/fruit.js"></script>


</body>

</html>

代碼沒(méi)有報(bào)錯(cuò)了 但是就是不顯示fruit怎么辦

正在回答

1 回答

fruitObject.prototype.draw=function(){
????for(var?i=0;i<this.name;i++){?????//應(yīng)該是i<this.num
????????ctx2.drawImage(this.orange,this.x[i],this.y[i]);
?
????}
?
}
0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

greenhandc 提問(wèn)者

早就解決了,我也忘記是什么問(wèn)題了。。
2016-01-07 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
HTML5小游戲---愛(ài)心魚(yú)(上)
  • 參與學(xué)習(xí)       92344    人
  • 解答問(wèn)題       577    個(gè)

學(xué)做HTML5游戲,輕輕松松帶你上手,適合剛?cè)胧钟螒蜷_(kāi)發(fā)的同學(xué)

進(jìn)入課程

fruit的問(wèn)題,怎么這一節(jié)問(wèn)題這么少

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)