Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.61 KB | None | 0 0
  1.     local function replaceSprite(self, name)
  2.         modApi:appendAsset("img/units/player/"..name..".png",self.resourcePath.."/units/"..name..".png")
  3.     end
  4.  
  5.     sprites = {
  6.         "auto_mech_big",
  7.         "auto_mech_idle",
  8.         "auto_mech_spider",
  9.     }
  10.  
  11.     for i, name in ipairs(sprites) do
  12.         replaceSprite(self, name)
  13.         replaceSprite(self, name.."_a")
  14.         replaceSprite(self, name.."_broken")
  15.         replaceSprite(self, name.."_ns")
  16.         replaceSprite(self, name.."_h")
  17.         replaceSprite(self, name.."_w")
  18.         replaceSprite(self, name.."_w_broken")
  19.     end
  20.    
  21.     ANIMS.AUTO_MechBig =            ANIMS.MechUnit:new{ Image = "units/player/auto_mech_big.png", PosX = -19, PosY = -14 }
  22.     ANIMS.AUTO_MechBiga =           ANIMS.MechUnit:new{ Image = "units/player/auto_mech_big_a.png", PosX = -19, PosY = -14, NumFrames = 4 }
  23.     ANIMS.AUTO_MechBigw =           ANIMS.MechUnit:new{ Image = "units/player/auto_mech_big_w.png", PosX = -17, PosY = -4 }
  24.     ANIMS.AUTO_MechBig_broken =     ANIMS.MechUnit:new{ Image = "units/player/auto_mech_big_broken.png", PosX = -17, PosY = -2 }
  25.     ANIMS.AUTO_MechBigw_broken =    ANIMS.MechUnit:new{ Image = "units/player/auto_mech_big_w_broken.png", PosX = -14, PosY = 6 }
  26.     ANIMS.AUTO_MechBig_ns =         ANIMS.MechIcon:new{ Image = "units/player/auto_mech_big_ns.png" }
  27.    
  28.     ANIMS.AUTO_MechIdle =       ANIMS.MechUnit:new{ Image = "units/player/auto_mech_idle.png", PosX = -18, PosY = -5 }
  29.     ANIMS.AUTO_MechIdlea =      ANIMS.MechUnit:new{ Image = "units/player/auto_mech_idle_a.png", PosX = -18, PosY = -5, NumFrames = 4 }
  30.     ANIMS.AUTO_MechIdlew =      ANIMS.MechUnit:new{ Image = "units/player/auto_mech_idle_w.png", PosX = -18, PosY = 8 }
  31.     ANIMS.AUTO_MechIdle_broken =    ANIMS.MechUnit:new{ Image = "units/player/auto_mech_idle_broken.png", PosX = -18, PosY = -5 }
  32.     ANIMS.AUTO_MechIdlew_broken =   ANIMS.MechUnit:new{ Image = "units/player/auto_mech_idle_w_broken.png", PosX = -18, PosY = 8 }
  33.     ANIMS.AUTO_MechIdle_ns =     ANIMS.MechIcon:new{ Image = "units/player/auto_mech_idle_ns.png" }
  34.  
  35.     ANIMS.AUTO_MechSpider =         ANIMS.MechUnit:new{ Image = "units/player/auto_mech_spider.png", PosX = -20, PosY = -1}
  36.     ANIMS.AUTO_MechSpidera =        ANIMS.MechUnit:new{ Image = "units/player/auto_mech_spider_a.png", PosX = -20, PosY = -1, NumFrames = 4 }
  37.     ANIMS.AUTO_MechSpiderw =        ANIMS.MechUnit:new{ Image = "units/player/auto_mech_spider_w.png", PosX = -22, PosY = 8 }
  38.     ANIMS.AUTO_MechSpider_broken =  ANIMS.MechUnit:new{ Image = "units/player/auto_mech_spider_broken.png", PosX = -20, PosY = 1 }
  39.     ANIMS.AUTO_MechSpiderw_broken = ANIMS.MechUnit:new{ Image = "units/player/auto_mech_spider_w_broken.png", PosX = -19, PosY = 10 }
  40.     ANIMS.AUTO_MechSpider_ns =      ANIMS.MechIcon:new{ Image = "units/player/auto_mech_spider_ns.png" }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement