tinyHeart/js/mam.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

var mamObj=function(){
	this.x;
	this.y;
	this.angle;
	this.bigEye=new Image();
	this.bigBody=new Image();
	this.bigTail=new Image();

	this.mamEyeTimer=0;
	this.mamEyeCount=0;
	this.mamEyeInterval=1000;

	this.bigTailTimer=0;
	this.bigTailCount=0;


	this.mamBodyTimer=0;
	this.mamBodyCount=0;
	this.mamBodyInterval=1000;



}
mamObj.prototype.init=function()
{
	this.x=canWidth*0.5;
	this.y=canHeight*0.5;
	this.angle=0;




}
mamObj.prototype.draw=function()
{
	
	this.x=lerpDistance(mx,this.x,0.95);
	this.y=lerpDistance(my,this.y,0.95);

	var delteY=my-this.y;
	var delteX=mx-this.x;
	var beta=Math.atan2(delteY,delteX)+Math.PI;

	this.angle=lerpAngle(beta,this.angle,0.6);

	this.bigTailTimer+=deltaTime;
	if(this.bigTailTimer>50)
	{
		this.bigTailCount=(this.bigTailCount+1)%8;
		this.bigTailTimer%=50;
	}

	this.mamEyeTimer+=deltaTime;
	if(this.mamEyeTimer>this.mamEyeInterval)
	{
		this.mamEyeCount=(this.mamEyeCount+1)%2;
		this.mamEyeTimer%=this.mamEyeInterval;
		if(this.mamEyeCount==0)
		{
			this.mamEyeInterval=Math.random()*1500+2000;
后面还有 43 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。