Main menu then onto game already created

I have a question for you guys, how do you make a menu that can link up to separate project I have already made? Is there some sort of linking system? Do i have to copy and paste my other project onto the a menu one? How do you actually do it thanks everyone if you could help I would appreciate it :))

You can just add the 2nd project as a dependency in the menu project. Click the + in top right when viewing your menu project. Then select your project under the dependencies list.

@Tobatar note that when you merge projects into a new one using dependency, the main tab of your projects are not used (at least i read that some time ago).

@Tobatar If I understand your question, you have several projects that are already coded that you run individually now. Each one has a setup(), draw(), etc. You want to make another project that is basically a menu showing your projects so you can select one of them and it will run. If that’s your intent, then NO, you can’t do that.

Actually you could do that. Create a new project that loads a menu. Then you can load up each project as needed into a new environment and run it. Similar to how Codea Community loads projects.

I’m working on an example for you that will read your dependencies and create a button for each then load each project when clicked.

Here is a super simple version. Just change PROJECTNAME to the name of your project and add dependencies. There is currently no back button, but I will be adding one soon.

@Briarfox You said “Here is a super simple version”. I think this is larger than the majority of the projects I have. I tried it and it works like a charm. The back button will be a great addition. I didn’t think that was possible, I’ll have to look thru your code to see what’s going on.

@dave1707 the code is really short. It’s cider controls thats long. I’ll get the back button working and allow the buttons to scroll. This is actually a great idea from you and @tobatar. I like the quick method for showing off my projects.

@Briarfox I had a chance to look thru your code and I like the file Info.plist. Since I only use Codea on my iPad, I don’t know the different files (paths and names) that can be read and what’s in them. Dumping the contents of a plist file, I see that it includes all files that are checked as a dependency. That now gives me a “hacked” way of selecting which projects I want to backup to Dropbox. I can now just bring up the dependency list, check which projects I want to backup, read the plist file for dependencies, and backup those projects to Dropbox. It’s not an elegant way of doing it, but it works better than having to key in all the project names. This will do until we get a listProjects command. Thanks for showing me Info.plist. What other files (path/name) are there that might be of interest.

Codea Community reads the dependencies and backs them up as well :slight_smile: glad you found the code usefull!

im new to codea but i really want a menu that controls when another project starts - i am lead to believe the code provided here can do that, however i am confused on how to set it up; it keeps coming up with an error message

@Briarfox, adding a back button is quite simple. Simply replace the runCode function with this:

EDIT: Didn’t think this through… Becomes un functional when you go back.

EDIT2: Fixed it. Shared it on CC to just Briarfox

can anyone assist me?

@OwenClaxton, Briarfox’s code works as follows:

  1. Open his project

  2. Click on the plus in the upper right hand corner and find your game

  3. Click the check box next to your game

  4. Run his project - There should be a button with your game name that loads your game when you select it.

I have tried this and it hasnt worked…all it says is no dependicies found…any ideas to fix this

wont work for me

It happened to me, just de-select it and select it again and repeat until it works

EDIT @JakAttak, you forgot to say that you have to change the Project Name at the top?