[Solved]Last step on completing my Game!!

  ... discussions about development with the GLES2 branch of AndEngine.

[Solved]Last step on completing my Game!!

Postby CoolMan1999x » Fri May 03, 2013 3:43 pm

I am on the last step of completing my game and then the rest are only graphics and scenes. So the last question is how can I change values every second like this:
I want to change this value:
Syntax: [ Download ] [ Hide ]
Using javascript Syntax Highlighting
  1. float Clouds = 10f;
  2.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Every second by removing 1 from it so it will become 9f and then 8f and then 7f and so on :D
Last edited by CoolMan1999x on Mon May 06, 2013 12:51 pm, edited 2 times in total.
User avatar
CoolMan1999x
 
Posts: 89
Joined: Fri Apr 05, 2013 5:27 pm

Re: Last step on completing my Game!!

Postby Ungaze » Fri May 03, 2013 3:53 pm

create a timer handler and subtract 1 everytime it ticks like so:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. scene.registerUpdateHandler(new TimerHandler(1f, true, new ITimerCallback() {
  2.                        
  3.         @Override
  4.         public void onTimePassed(TimerHandler pTimerHandler) {
  5.                 Clock =- 1f;
  6.         }
  7. }));
Parsed in 0.029 seconds, using GeSHi 1.0.8.4


You could use "Clock--;" but I just showed it like in the above in case you want to use a different value.
User avatar
Ungaze
 
Posts: 409
Joined: Fri Jul 06, 2012 10:53 am

Re: Last step on completing my Game!!

Postby CoolMan1999x » Sat May 04, 2013 1:24 pm

Thx ungaze ill try it out :D
User avatar
CoolMan1999x
 
Posts: 89
Joined: Fri Apr 05, 2013 5:27 pm

Re: Last step on completing my Game!!

Postby CoolMan1999x » Sat May 04, 2013 1:49 pm

Thnx again Ungaze but it doesn't seem to work :( . No timerhandler value has chaged.


Heres what I did:
Syntax: [ Download ] [ Hide ]
Using javascript Syntax Highlighting
  1.     TimerHandler increase;
  2.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         increase = new TimerHandler(1f, true,
  2.                 new ITimerCallback() {
  3.          
  4.                 @Override
  5.                 public void onTimePassed(TimerHandler pTimerHandler) {
  6.                     Enems0 =- 1f;
  7.                     Enems =- 1f;
  8.                     Enems2 =- 1f;
  9.                     Enems3 =- 1f;
  10.                     Enems4 =- 1f;
  11.                     Enems5 =- 1f;
  12.                     Enems6 =- 1f;
  13.                     Enems7 =- 1f;
  14.                     Scored =- 1f;
  15.                     Clouds =- 1f;
  16.                     Clouds2 =- 1f;
  17.                     Clouds3 =- 1f;
  18.                     Clouds4 =- 1f;        
  19.                     Clouds5 =- 1f;
  20.                     Clouds6 =- 1f;
  21.                    
  22.                 }
  23.             });
  24.  
  25.     mMainScene.registerUpdateHandler(increase);
  26.  
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


So please what do you think

Hers the values of clouds, scores and Enems :
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     float Enems0 = 3.5f;
  2.     float Enems = 4f;
  3.     float Enems2 = 5f;
  4.     float Enems3 = 6f;
  5.     float Enems4 = 2.5f;
  6.     float Enems5 = 4.5f;
  7.     float Enems6 = 5.5f;
  8.     float Enems7 = 7f;
  9.     float Scored = 0.1f;
  10.     float Clouds = 2f;
  11.     float Clouds2 = 3.5f;
  12.     float Clouds3 = 4.5f;
  13.     float Clouds4 = 4f;        
  14.     float Clouds5 = 6f;
  15.     float Clouds6 = 8f;
  16.  
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
User avatar
CoolMan1999x
 
Posts: 89
Joined: Fri Apr 05, 2013 5:27 pm

Re: [Not sloved]Last step on completing my Game!!

Postby CoolMan1999x » Sun May 05, 2013 1:29 pm

Weird can you find any problem with it :?:
User avatar
CoolMan1999x
 
Posts: 89
Joined: Fri Apr 05, 2013 5:27 pm

Re: [Not sloved]Last step on completing my Game!!

Postby yhyang » Sun May 05, 2013 2:06 pm

I believe ungaze had described his intention clearly, you should be able to find the typo yourself.
It is "Clock -= 1f", not "Clock =- 1f".
yhyang
 
Posts: 115
Joined: Thu Nov 22, 2012 9:46 am
Location: Taiwan

Re: [Not sloved]Last step on completing my Game!!

Postby CoolMan1999x » Sun May 05, 2013 4:46 pm

Thank you for your reply but I tried that as Ungaze said but still no result nothing :(
User avatar
CoolMan1999x
 
Posts: 89
Joined: Fri Apr 05, 2013 5:27 pm

Re: [Not sloved]Last step on completing my Game!!

Postby yhyang » Sun May 05, 2013 6:03 pm

Maybe you misunderstand what I mean. The typo is not "Clouds vs Clock", it is "-= 1 vs = -1".
yhyang
 
Posts: 115
Joined: Thu Nov 22, 2012 9:46 am
Location: Taiwan

Re: [Not sloved]Last step on completing my Game!!

Postby Ungaze » Sun May 05, 2013 7:58 pm

Sorry for the mishap :D

Simply put change "=-" to "-=" or just change the whole line to "Clock --;". Thanks yhyang ;)
User avatar
Ungaze
 
Posts: 409
Joined: Fri Jul 06, 2012 10:53 am

Re: [Not sloved]Last step on completing my Game!!

Postby CoolMan1999x » Mon May 06, 2013 12:41 pm

Nope yhyang

I didn't misunderstand what you said, I wasn't talking about clouds and clock instead I was talking about -= 1f and =- 1f which I both tried.

Ungaze

I tried Clock-- (Clouds--) but that sadly gave me no result.

I just don't know why :( but really thanx both of you for you answers :)
User avatar
CoolMan1999x
 
Posts: 89
Joined: Fri Apr 05, 2013 5:27 pm

Next

Return to GLES2

Who is online

Users browsing this forum: Elminister, Unregistered, Yahoo [Bot] and 29 guests