Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.iMackshun.Games.SoulBlazeRPG.Objects;
- import com.badlogic.gdx.Gdx;
- import com.iMackshun.Games.SoulBlazeRPG.SoulBlazeRPG;
- public class TimeManager {
- //Object Properties
- private int Digit1;
- private int Digit2;
- private int Digit3;
- private int Digit4;
- private int Digit5;
- private int Digit6;
- private float TimeElapsed;
- //Constructor
- public TimeManager(){
- Digit1 = 0;
- Digit2 = 0;
- Digit3 = 0;
- Digit4 = 0;
- Digit5 = 0;
- Digit6 = 0;
- }
- //Personal Methods
- public void update(float delta){
- TimeElapsed += delta;
- if(TimeElapsed >= 1){
- //A second has passed...
- Gdx.app.log(SoulBlazeRPG.LOG, "A second has passed...");
- Digit1++;
- TimeElapsed = 0;
- }
- if(Digit1 >= 10){
- Digit2++;
- Digit1 = 0;
- }
- if(Digit2 >= 6){
- Digit3++;
- Digit2 = 0;
- }
- if(Digit3 >= 10){
- Digit4++;
- Digit3 = 0;
- }
- if(Digit4 >= 6){
- Digit5++;
- Digit4 = 0;
- }
- if(Digit5 >= 10){
- Digit6++;
- Digit5 = 0;
- }
- if(Digit6 >= 10){
- //Wow...you really play this game too much...
- Gdx.app.log(SoulBlazeRPG.LOG, "Wow, you really play this game too much...");
- }
- }
- //Getters and Setters
- public int getDigit1() {
- return Digit1;
- }
- public int getDigit2() {
- return Digit2;
- }
- public int getDigit3() {
- return Digit3;
- }
- public int getDigit4() {
- return Digit4;
- }
- public int getDigit5() {
- return Digit5;
- }
- public int getDigit6() {
- return Digit6;
- }
- public void setDigit1(int digit1) {
- Digit1 = digit1;
- }
- public void setDigit2(int digit2) {
- Digit2 = digit2;
- }
- public void setDigit3(int digit3) {
- Digit3 = digit3;
- }
- public void setDigit4(int digit4) {
- Digit4 = digit4;
- }
- public void setDigit5(int digit5) {
- Digit5 = digit5;
- }
- public void setDigit6(int digit6) {
- Digit6 = digit6;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment