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.
Try this:
function M.createLevel(radarGroup, group, numOfAsteroids)
local masterM = require “levels-management.moduleaccessor”
local player = masterM.ship.new(group)
masterM.asteroids.new(group, numOfAsteroids)
masterM.enemyHUD.create(radarGroup, nil, nil, 45, display.contentHeight * 1.5)
local hud = masterM.enemyHUD.getHUD()
print(">>>>>>>>>>>>>>>>>>>HUD = ", hud)
end
return M
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,
-OR-
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.