It looks like you're new here. If you want to get involved, click one of these buttons!
Player = Core.class (Sprite) --inherit Sprite class properties and create Player class
function Player:init (name) --init the class properties, name is supposed to be given when creating this class
self.name= name --get player name and save it as object property
--here you can add everything you may need, from textures to "hitpoints"
function Player:displayName () --this is a method of Player class. I choose just to print the name of the player, it could be anything else (hit, jump, growteeth...)
print ("player name", self.name) --print the name
local playerpuppet = Player.new ("jack") --create a new instance of Player, with name "jack"
playerpuppet:displayName () --call the method of Player to display its name
--eventually you can add it to stage or another Sprite (to 'see' it you need to add a texture somewhere, for example in init () )