Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _M.newEnemy (params)
- local enemy = createEnemySpriteHere
- -- assign properties
- enemy.isAlive = true
- function enemy:init ()
- -- optional initialization function
- end
- function enemy:walk ()
- -- walking here for example
- end
- function enemy:stop ()
- -- stop
- end
- function enemy:hit (damage)
- -- damaging
- end
- function enemy:update ()
- -- whatever
- end
- function enemy:destroy ()
- -- clean up and removal
- end
- return enemy
- end
- return _M
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement