Global variable or Dictionary entry?

0 favourites
  • 3 posts
From the Asset Store
Globals 2.0
$3.60 USD
10% off
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • C3 guru's, thanks for checking out this topic.

    As I make my way through this first game, I've set 10+ global variables for different things I need to reference in the programming. All told, I have probably torn apart several games to see how they run and noticed most don't have a lot of global variables but many dictionary entries instead.

    So my question to those that know C3 inside and out, what is the better path for a game (maybe I'm not asking the right question).; using dictionary entries and calls or global variables?

    Thanks in advance for your time.

  • It's entirely up to you. Global variables are easier to deal with, but may become difficult to manage if you have lots of them.

    You can have a mix of both. For example, I prefer to keep some values in the dictionary (say, game settings). And others, which are frequently used, in global variables.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Doing the same as dop2000.

    Values that are not safed and just for a convenience for me as the developer I use as global variables. So that I can easily see and manage them. Everything that needs to be safed I use a dictionary for.

    Also I like to use json a lot.

    If you know the RPG maker, with JSON you can make things like:

    attacker.atk - defender.def

    And so on.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)