If Entity is shown draw it
This commit is contained in:
@ -162,18 +162,19 @@ function drawBackground(refImage){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function drawEntity(entity){
|
function drawEntity(entity){
|
||||||
|
if (entity.show){
|
||||||
push();
|
push();
|
||||||
imageMode(CENTER);
|
imageMode(CENTER);
|
||||||
translate(entity.x*(worldScale.value()/100), entity.y*(worldScale.value()/100), 0);
|
translate(entity.x, entity.y, 0);
|
||||||
if (entity.type == entityTypes.COMET){
|
if (entity.type == entityTypes.COMET){
|
||||||
rotate((Math.atan2(entity.vx, entity.vy) - Math.atan2(-1,0)) * 180/Math.PI);
|
rotate((Math.atan2(entity.vx, entity.vy) - Math.atan2(-1,0)) * 180/Math.PI);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
rotate(entity.rot);
|
rotate(entity.rot);
|
||||||
}
|
}
|
||||||
image(images[entity.type], 0,0);
|
image(images[entity.type], 0,0);
|
||||||
pop();
|
pop();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function preload(){
|
function preload(){
|
||||||
images[entityTypes.METERORITE_SMALL] = loadImage("/media/Art/meteorite_small_1.png");
|
images[entityTypes.METERORITE_SMALL] = loadImage("/media/Art/meteorite_small_1.png");
|
||||||
|
|||||||
Reference in New Issue
Block a user