0 votes

Hello,

I'm a high school teacher using Godot with my game design class. I want to create an arcade to showcase my students' work and allow their peers to try them out. How would I go about combining multiple completed games? I also figured I'd create a splash screen and some type of game selection screen so that they can choose which game to play.

I'm fairly new to Godot, and would greatly appreciate any help the community has to offer.

asked Jan 2, 2019 in Engine by BHS_Game_Design (15 points)

1 Answer

+2 votes
Best answer

You can create a launcher, much like the Project Manager, then execute the template with the data path of the game you want to play.

Look at OS functions, OS.execute() and OS.get_executable_path ( ), also the command line arguments to use the templates to run games, I think that is only the executable + package path.


For sources I do not recommend to mix projects because it will be a mess for your students, but if you still want to do it, just drop the files on a single project, if these do not overlap, the scenes should be possible to be instance anywhere.

answered Jan 2, 2019 by eons (7,731 points)
selected Feb 28, 2019 by BHS_Game_Design

For the students it probably doesn't have to be a mess per se, from what I can tell BHSGameDesign is looking to compile it for students to play the games, not read the code. However, it can get messy trying to mix and match these different projects nonetheless, if singletons are used in the projects and overlapping names are used, there is a problem. Input settings, pose a problem. Etcetera. Different project settings all in all will be a nightmare to deal with. Simply instancing the scenes may very likely produce non-desirable results.

So I would definitely aim for creating a launcher as suggested by eons as well.

Thanks for your help. I'm finally able to start testing this idea but I'm running into issues with OS.get_executable_path ( ) or OS.shell_open().

I have a simple start screen with a button for each game. When the player clicks the button, the selected game should open.

Here are the two lines I've tried:
OS.get_executable_path("C:\\Users\\Student\\Documents\\Arcade\\MouseMovementTest.exe")

OS.shell_open("C:\\Users\\Student\\Documents\\Arcade\\MouseMovementTest.exe")

I'm sure that I'm missing something here, and I've tried to make sense of the documentation, but I'm having trouble there as well. Of those two lines, OS.shell_open() has worked, but not in the way I expected. Instead of opening "MouseMovementTest" Godot opens the current start screen file in a new window.

Do you have any thoughts? Or should I post this issue as a new question?

The main issue is setting the working directory, by default it takes the executable path and every godot template will open the currently running project.

An easy way to solve this could be setting up windows shortcuts (lnk or bat/cmd files) with the correct paths, these may be able to use relative paths too, and open it with shell_open.

Another is to use the method mentioned on the documentation which should be like
OS.execute('cmd', ['/C', 'cd project_dir && chdir && executable'], true, output)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.