How do I set variable from firebase to control layouts?

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi everyone, hope you are doing well :)

    I will be hosting an event with a very simple game, just a clicker game. Using Sparsha´s great firebase plugin, I can register, read and write the user, email, scores, leaderboards, etc. No problem here.

    I would like to terminate the game after x time for every player at the same time.

    Here is my idea: Read from database line "Users are playing" set to 1 or 0 and make the game check this every 1 -5 secs.

    If that variable (that updates from the DB) is 0, let them play

    If that variable (that updates from the DB) is 1, send them to the leaderboard/endgame

    I can change the value in firebase, and see it reflected in my game ok, however, it´s not responding the action.b

    Any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't need to check the variable on every tick - move events #4,5 on you screenshot inside event #3, as sub-events.

    I don't have much experience with Firebase and your code seems ok to me. Maybe the data is not received from the server, or it's in lowercase. Try running the game in Debug Mode and you will see if the variable changes.

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