I would like to create a count down feature on my game just like the lives in Candy Crush or Trivia Crack. Every 60 minutes, the player gets a new life (up to 3 lives).
So my first question is: is it a good idea to control the player's lives from the backend side or simply having a countdown timer in the client itself suffices?
If choosing GameSparks to build this, what should be my approach? What functions in Cloud Code should be used? Do I create a new Player property where the client keeps reading from?
Thanks!
Best Answer
S
Sean Young
said
over 6 years ago
I think the best way is to have a timer on the client, and when that is done it calls an event with cloud code that compares the current time to the last time the user was granted a life. If the cloud code determines that it has been 60 minutes then you respond to the client with a success boolean and if not, just send back the remaining time and have the client's timer update. This way you're not doing much code in the cloud and also user's can't just fast forward time in the client or try to cheat. I'll be doing something similar with my game soon.
I'm still new to Gamesparks but this way seems to make sense in my head.
I think the best way is to have a timer on the client, and when that is done it calls an event with cloud code that compares the current time to the last time the user was granted a life. If the cloud code determines that it has been 60 minutes then you respond to the client with a success boolean and if not, just send back the remaining time and have the client's timer update. This way you're not doing much code in the cloud and also user's can't just fast forward time in the client or try to cheat. I'll be doing something similar with my game soon.
I'm still new to Gamesparks but this way seems to make sense in my head.
1 person likes this
F
Felipe Caldas
said
over 6 years ago
Thanks Sean! Your suggestion makes sense indeed! I will try to create something like that myself. Cheers
Felipe Caldas
Hi all,
I would like to create a count down feature on my game just like the lives in Candy Crush or Trivia Crack. Every 60 minutes, the player gets a new life (up to 3 lives).
So my first question is: is it a good idea to control the player's lives from the backend side or simply having a countdown timer in the client itself suffices?
If choosing GameSparks to build this, what should be my approach? What functions in Cloud Code should be used? Do I create a new Player property where the client keeps reading from?
Thanks!
I think the best way is to have a timer on the client, and when that is done it calls an event with cloud code that compares the current time to the last time the user was granted a life. If the cloud code determines that it has been 60 minutes then you respond to the client with a success boolean and if not, just send back the remaining time and have the client's timer update. This way you're not doing much code in the cloud and also user's can't just fast forward time in the client or try to cheat. I'll be doing something similar with my game soon.
I'm still new to Gamesparks but this way seems to make sense in my head.
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstSean Young
I think the best way is to have a timer on the client, and when that is done it calls an event with cloud code that compares the current time to the last time the user was granted a life. If the cloud code determines that it has been 60 minutes then you respond to the client with a success boolean and if not, just send back the remaining time and have the client's timer update. This way you're not doing much code in the cloud and also user's can't just fast forward time in the client or try to cheat. I'll be doing something similar with my game soon.
I'm still new to Gamesparks but this way seems to make sense in my head.
1 person likes this
Felipe Caldas
Thanks Sean! Your suggestion makes sense indeed! I will try to create something like that myself. Cheers
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics