Things that could be happening:
- M.new() called before M.createLevel()
- M.new() called after deleting the hud
- You may have incorrectly modified the module.
function M.createLevel(radarGroup, group, numOfAsteroids)
local masterM = require "levels-management.moduleaccessor"
local player = masterM.ship.new(group)
masterM.enemyHUD.create(radarGroup, nil, nil, 45, display.contentHeight * 1.5)
local hud = masterM.enemyHUD.getHUD()
print(">>>>>>>>>>>>>>>>>>>HUD = ", hud)
Then look in the console to see what the message says
Other than that, you need to add more messages to your code to debug what is going on,
You need to get someone (a mentor?) to help you hands on with your whole project.
It is hard to get a complete view of what you're doing from just the code you posted.