Problem Following Tutorial - Type not found: FlxOgmoLoader
-
I was trying to follow the standard tutorial and am having problems at part 6.
https://haxeflixel.com/documentation/loading-the-tilemap/I am using VSCode (a little confused as the installation instructions said it was preferred, but the tutorial recommends FlashDevelop).
I have un-commented the line
<haxelib name="flixel-addons" />
in myProject.xml
, and in myPlayState.hx
I have the lineimport flixel.addons.editors.ogmo.FlxOgmoLoader;
I have ensuredflixel-addons
is installed.The problem is, under
PROBLEMS
vs code givesseverity: 'Error' message: 'Type not found : flixel.addons.editors.ogmo.FlxOgmoLoader' at: '7,8' source: 'haxe' code: 'undefined'
Also, when I try to go to the playstate, the game freezes. Any ideas?
-
The VSCode template uses hxml files that are generated on compilation for code completion (by default the Flash one for the Flash target). If you're building for another target, the selected hxml file won't have the flixel-addons dependency yet. You can change this in the status bar.
I'd recommend to use the Lime extension instead, which doesn't rely on those HXML files and updates dynamically instead:
https://marketplace.visualstudio.com/items?itemName=openfl.lime-vscode-extension
Since it generates tasks for you, you should delete any tasks from tasks.json that you're not using for debugging.
The VSCode docs will be updated for use with the Lime extension soon.
-
Thanks for the reply! Would you reccomend FlashDevelop over VSCode, or do you think there is a big difference? It seems the VSCode may not have as much documentation.
-
I'm one of the maintainers of the VSCode plugin, so I guess I'm too biased to comment. ;)
Vshaxe has a decent amount of documentation:
-
The VSCode instructions and flixel-templates have now been updated to use the Lime extension:
https://haxeflixel.com/documentation/visual-studio-code/
(try Shift+F5 to clear the cache if you're still seeing the old version of the page)