Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To Add Fungus Branching Paths to fighting game #1068

Open
MaximumMarc opened this issue May 20, 2024 · 1 comment
Open

How To Add Fungus Branching Paths to fighting game #1068

MaximumMarc opened this issue May 20, 2024 · 1 comment

Comments

@MaximumMarc
Copy link

I was wondering how to include a level select menu in Fungus, where the first level button activates a Fungus story that will determine what 10 level buttons will become visible next depending on what option the player chooses. Each of the 10 levels involve fighting and defeating enemies. After those levels have been completed a new button appears underneath the title button representing the level menu the player just completed, the new title button will contain levels corresponding to the player’s choice in the first level menu. And the first level button in this menu would also contain choices the player could make which decide which 10 level buttons appear next and what level menu will be available after completing them. This pattern will continue until the player reaches the end of the story. How can this game be made using fungus, and how do I make sure the player can’t go back and choose a different option if they’ve already chosen once?

Fyi the forum isn’t loading which is why I posted this question here.

@Arylos07
Copy link
Contributor

It sounds to me like there's other questions of design to answer here but I'm going to do a general overview. I'm going to make assumptions though so feel free to cater my thinking to your needs.

First off, you're going to need a saving solution. Fungus does have a built-in variable saving system although any good programmer would advise you to make your own; you can always import/export variables from your save system. I would then have your flowchart create different UI buttons or branches based on player progress, like a counter from 1 to 10 that increments with each fight they win. With each increment, a new button appears. You would then save this counter somewhere.

Depending on how you structure your game, you can then have Fungus load different scenes for your fights or call functions on different flowcharts in the same scene for simplicity. Or the same flowchart that has an if branch checking on this internal counter and determines what actually happens; ranging from difficulty to dialogue.

To restrict backtracking, you can still use the same counter to validate. In theory, I assume that only the next fight is made available while the past fights will appear as disabled UI elements. So realistically, activate the button for the current fight and make all others uninteractable (see the Clickable property on GUI elements like buttons; I use this all the time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants