Skip to content
Snippets Groups Projects
Commit daa2976d authored by Jacky Chen's avatar Jacky Chen
Browse files

updated gun, enemy

parent 75400400
Branches
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ class Enemy {
this.width = 64;
this.height = 64;
this.sprite = null;
this.lootbox = false;
}
addToObjectsList(objectList) {
......
......
......@@ -8,8 +8,6 @@ let length;
let g;
let gunAnim = {};
class gun{
constructor(x, y, weapon, f_ammo, t_ammo, dmg){
this.x = x;
......@@ -25,6 +23,7 @@ class gun{
app.loader.add("default", "../art/Player/Gun/pistol_sheet.png");
app.loader.add("awpGun", "../art/Player/Gun/Awp.png");
app.loader.add("smgGun", "../art/Player/Gun/smg.png");
app.loader.add("pistolR", "../art/Player/Gun/reload_sprite.png");
g = this;
c_amt = this.f_ammo;
......@@ -156,6 +155,7 @@ class gun{
let gun_sheet = new PIXI.BaseTexture.from(app.loader.resources["default"].url);
let awp_sheet = new PIXI.BaseTexture.from(app.loader.resources["awpGun"].url);
let smg_sheet = new PIXI.BaseTexture.from(app.loader.resources["smgGun"].url);
let reload_pistol = new PIXI.BaseTexture.from(app.loader.resources["pistolR"].url);
let width = 64;
let height = 64;
......@@ -176,7 +176,26 @@ class gun{
gunAnim["smg"] = [
new PIXI.Texture(smg_sheet, new PIXI.Rectangle(0 * width, 0, width, height))
]
];
gunAnim["pistolR"] = [
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(0 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(1 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(2 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(3 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(4 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(5 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(6 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(7 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(7 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(8 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(8 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(9 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(10 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(11 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(12 * width, 0, width, height)),
new PIXI.Texture(reload_pistol, new PIXI.Rectangle(0 * width, 0, width, height))
];
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment