Shooting new objects

I have a simple, yet confusing question for beginners like me. So I want to make my character be able to shoot lasers, and since I didn’t want to make the character class 5000 lines long, i decided to use a separate class for the laser. However, nothing of the sort was was showed in the knight game example in github, so i just tried the same method they used for displaying health bars, although it does work, but the laser moves together with the characer ( if you jump, so does the laser ). Am I somehow importing the class wrong or should I opt for a different method than in the example?

This is more of a game dev question than Tiled Map Editor question.Furthermore it’s impossible, to help without seeing the code, what’s the github example?

My bad, I assumed the tutorial was one of the main examples to learn from. Anyways, here’s the github code: https://github.com/coronalabs/Sticker-Knight-Platformer/
To be exact, I’m talking about these files:
https://github.com/coronalabs/Sticker-Knight-Platformer/blob/master/scene/game/lib/heartBar.lua
Thanks for your time

It is a good example, but you need to ask the right people if you have questions about how to expand upon it. That would be @ponywolf in particular, or the Corona SDK community in general.