A global variable

A feature I’d like to see in Hopscotch is:

A global variable. A global variable is a variable that saves like the player variable but it is the same for every player.

I’d use it for this type of project:

Any game that has a leaderboard.

Here are some examples of Hopscotch code that could be improved if we had this:

We could make games that automatically update their leaderboards.

Here is an example design I’ve made:

I’ve seen something similar in another programming languages, it looks like this:

I haven’t.

17 Likes

I agree, this would be useful.

I’ve done that here, actually – if you want to see the demo. It’s the text above Penguin

7 Likes

I think there’s already a topic about this.

2 Likes

Many topics like this have been made, but nice topic

3 Likes

but isn’t that what global variables are?
And yeah there’rem’nyt’p’csl’kethis

3 Likes

I didn’t see a topic like this. Could you link one.

1 Like

Basically the same
@Nameless_gamer

3 Likes

That’s pretty different, actually.

A global variable refers something every user can access separately rather than joining a session to access. You could in theory make multiplayer with this, but that’s not the idea.

7 Likes

Ok but I wasn’t talking about that topic

3 Likes

It’s similar but there are no servers. It’s just ppl that can see the same data that auto updates.

3 Likes

Oh so there is only one server
Oh wait I read the op wrong
So like it’s separate but people’s data will be shown on screen
Or other peoples things
So u can code a search bar to see others

3 Likes

I know – and there are some good ones too – but I don’t recall any with this much clarity or detail, especially given that this has a nice sketchup too.

2 Likes

Imagine you are playing Color rush (Platformer) (leaderboard updated) by Rapterdragon_83🐉 and you got a sweet new high score so you tell the creator. Then the creator has to go into his/her project and edit it. That can take a lot of time especially if lots of ppl are playing and getting new high scores. So the game updates itself each time a new high score is gotten. Lots of arcade games do this so they don’t have to keep going in the code and risk breaking it.

3 Likes

Yeah I know what u mean

3 Likes

Oh wow that’s cool.

2 Likes

Yes definitely

1 Like

Yes totally agree.
My Platformer is on excellent so i can’t update it constantly so I have to do it every too weeks. But if there is this variable then I don’t have to spend my tame writing down scores and alway updating my Platformer!

1 Like
Would this be helpful?
  • Yes
  • No
  • I don’t know
  • Accidental vote

0 voters

1 Like

The only thing I’m afraid of is if they make this variable then it will only be available to subscribers.

3 Likes

It prob will only be available to subscribers like the player variables. But it would still be really useful.

2 Likes