0
его все в одном файлUncaught TypeError: Объект # <asteroid> не имеет никакого метода «отображения»
его начало html5/JavaScript холст игра
кажется всякий solotion связывают библиотеки лучше (это все один файл) или добавление нового при создании объекта (который я сделал)
отлично работает код без объекта :/
сокращенный код
html codes
codes
var tempa = new asteroid(BASIC_L, 100, 300,300,0,0,2,2,0,0);
codes
function asteroid(type, hp, x, y, z, r, vx, vy, vz, vr)
{
this.type = type;
this.hp = hp;
this.x = x;
this.y = y;
this.z = z;
this.r = r;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.vr = vr;
function display(){
this.x += this.vx;
this.y += this.vy;
if(this.type == BASIC_L){
debug(this.type);
ctx.beginPath();
ctx.strokeStyle="#00fff0";
ctx.arc(this.x,this.y,100,0,2*Math.PI);
ctx.stroke();
}
}
}
//codes
function draw(){
//codes
tempa.display();
}
//codes
//html codes
Да, это сработало ... спасибо – hutty