It looks like you're new here. If you want to get involved, click one of these buttons!
Enemy01 = Core.class(Sprite) function Enemy01:init(xname, xposx, xposy) -- settings self.name = xname self.x = xposx self.y = xposy self.vx = 0 self.vy = 0 self.flip = 1 self.isonfloor = false self.isattacking = false self.lives = 3 self.accel = 500 self.friction = 150 self.maxspeed = 150 self.jumpspeed = GRAVITY / 2 end function Enemy01:createAnim(xanimname, xstart, xfinish, xanimslist) self.anims[xanimname] = {} for i = xstart, xfinish do self.anims[xanimname][#self.anims[xanimname] + 1] = xanimslist[i] end end |
Comments
Likes: hgy29, MoKaLux
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14, MoKaLux, antix
@Apollo14 I knew this bit Enemy02 = Core.class(Enemy) but then what do I put in the init()? only the values that are going to change? For example:
@hgy29 I have read on the forum about Core.class and how it is implemented by @atilim . That is a little bit too advanced for me so I cannot tell what should be done.
Likes: MoKaLux
Likes: antix