Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Trying to make a number go up in increments and not jump directly to a number.

Author
Message
Thugnificent
8
Years of Service
User Offline
Joined: 16th Aug 2016
Location:
Posted: 21st Aug 2016 21:43 Edited at: 21st Aug 2016 21:46
What i am trying to do is make the numbers increase 1 at a time, depending on how big the number is , it's speed will be affected.

Right now if i have 30 as an autonumberadded to the main games number, it just goes 30,60,90 in 3 seconds, and so on. Whereas i want it to go from 1,2,3,4 all the way to 90 in 3 seconds and so on.

I've been messing with it all day and haven't had any success.I did get it to work, but not perfectly.



I am using a 1 second timer() command to auto increaes the number every seocnd by 30, i made a forloop which increased the main Games count by 30, i had to use the sync() command to make all the numbers appear 30 times, however the problem is that it doesn't update continuously, it's making short pauses every 1 second ( i think the 2 sync()'s are confilicting), so any key presses/button presses freeze for 1 second or don't work at all until that 1 second is over.

Any ideas you guys have?
Thugnificent
8
Years of Service
User Offline
Joined: 16th Aug 2016
Location:
Posted: 21st Aug 2016 21:49 Edited at: 21st Aug 2016 21:53
OMG I was having trouble with this the whole freaking day and the fix was simple :S

That "print(screenFPS())" command was the culprit, upon removing it and putting it in the main loop outside of the for loop mentioned in the above code snipper, the slowdowns/pauses every second have stopped.

Now the numbers increase incremently, but they still get to 90 in 3 steps. 1,2,3..to 30 in the first second, short pause, then 31,32,33...in the 2nd second and so on. If there is any way to smooth that out too, i'd be glad to know it, so that it increases at a steady pace from 1 to 90 in 3 seconds.

EDIT: I have another problem with the above mentioned method now. Once the increments reach higher numbers, the number doesn't increase per second anymore, instead it takes more time. E.G an increment of 1000 takes more than 5 seconds now instead of 1 it should. I am assuming the for loop is taking time which is making it slow? Dammit, another problem <_<
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Aug 2016 07:19
this counts to 90 in 3 seconds
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 22nd Aug 2016 11:10
Check the Tween commands - particularly the CustomTweens.
They are exactly what you are looking for.
AGK V2 user - Tier 1 (mostly)
Thugnificent
8
Years of Service
User Offline
Joined: 16th Aug 2016
Location:
Posted: 22nd Aug 2016 14:13 Edited at: 22nd Aug 2016 14:38
Hey thanks a lot Scraggle,

i am trying the Tweens, i cannot get them to work. like at all :S

Can you please help!
EDIT: I mean the Custom integers one (the sprite ones work fine but i cannot get anything to display with the Custom integers tweens)

@Markus, thanks for the reply, while it's not what i am looking for i highly appreciate it!

Login to post a reply

Server time is: 2024-11-25 03:56:38
Your offset time is: 2024-11-25 03:56:38