This site requires JavaScript, please enable it in your browser!
Greenfoot back
dark_sky
dark_sky wrote ...

2012/8/24

Name collisions

dark_sky dark_sky

2012/8/24

#
Hey everyone, I coded a little platforming game and a seperate level editor. Now I want to combine them to a single game but I got a little problem. The classes of the game itself have the same names as the classes of the level editor (e.g. Player, Item, Box,...). I didn't merge the two games because obviously I would get a lot of errors because the classes are not unique. Can you recommend me a way of preventing this? Is there maybe an option to define namespaces and use the classes like
new LevelEditor.Item();
? Thank you for your help.
steved steved

2012/8/24

#
Just put the games the scenarios together and rename all conflicting classes to something like LevelEdit'classname'. By the way why did you make the level editor a different scenario?
You need to login to post a reply.