automagically scale the gun
@@ -45,8 +45,8 @@ var Canvas =
45
45
this.context.fillRect(xStart, yStart, xEnd, yEnd);
46
46
},
47
47
48
drawImage(img, x, y)
48
drawImage(img, x, y, w, h)
49
49
{
50
this.context.drawImage(img, x, y);
50
this.context.drawImage(img, x, y, w, h);
51
51
}
52
52
}
@@ -45,8 +45,8 @@ var Canvas =45
this.context.fillRect(xStart, yStart, xEnd, yEnd);45
this.context.fillRect(xStart, yStart, xEnd, yEnd);46
},46
},47
47
48
drawImage(img, x, y)48
drawImage(img, x, y, w, h)49
{49
{50
this.context.drawImage(img, x, y);50
this.context.drawImage(img, x, y, w, h);51
}51
}52
}52
}@@ -184,7 +184,11 @@ var Player =
184
184
break;
185
185
}
186
186
187
Canvas.drawImage(gunImg.g_image, GameWindow.width * this.gunX, GameWindow.height * this.gunY);
187
var p = (GameWindow.height / 1080)
188
var w = p * gunImg.g_image.width;
189
var h = p * gunImg.g_image.height;
190
191
Canvas.drawImage(gunImg.g_image, GameWindow.width * this.gunX, GameWindow.height * this.gunY, w, h);
188
192
}
189
193
}
190
194
@@ -184,7 +184,11 @@ var Player =184
break;184
break;185
}185
}186
186
187
Canvas.drawImage(gunImg.g_image, GameWindow.width * this.gunX, GameWindow.height * this.gunY);187
var p = (GameWindow.height / 1080)188
var w = p * gunImg.g_image.width;189
var h = p * gunImg.g_image.height;190
191
Canvas.drawImage(gunImg.g_image, GameWindow.width * this.gunX, GameWindow.height * this.gunY, w, h);188
}192
}189
}193
}190
194