banner



Can You Draw Text Stencyl That Disappears After Seconds

Hello!

I'thou working my way through the  student activities and I'grand stuck on Lesson 3: Timer (Bonus Activity).
I've managed to create a timer that counts downwardly happily, but I can't figure out how to  testify  it consistently in X:Xx format. Whenever the seconds attain <x they go to a single digit.  I'grand assuming I demand to add in another line that says something like - if Seconds between ane - ix .... then..  just I'm wondering if I'm making it more complicated than a student activity warrants?

Thanks,
E


Clue: Utilize another attribute for the middle X.


Okay, I've created another attribute, handily called XX.  >.> What I hoped to do was have it fatigued in with the other timer values. Withal, while information technology shows up, it also doesn't leave. I've tried adding onto my [do every ane seconds]: If Seconds <= ten  set up XX to 0 ;  merely I don't know how to write in - if <ten be visible; if >10 be invisible command.


I would dearest if the number attribute could be 07 - unfortunately I take no inkling how to manage that then instead I'm trying to get my game to draw in a 0 in front of the numbers when <ten.  So the game should be: Time= 0:  12, 0:  11, 0:  ten, 0:09, 0:08 etc. Not exactly the best to look at only I'm doing what I tin can with my beginner skills. Unfortunately what I'1000 getting is: 0:012, 0:011, 0:010, 0:09 :(


In your drawing event, after you set the font and colors, put an "if visible" block with the attribute text's drawing code in information technology. Then have it set to imitation from the other event lawmaking for that attribute if you want it to disappear.

Edit: All of those cartoon events after cartoon "Fourth dimension" could accept been in one code block.


Hey, thanks for replying! Sadly I'1000 new plenty to Stencyl that I'm not quite sure what you want me to do (I think I'm confused over the terminology)? What is an "if visible" block - and where do I discover it? I can see the "If" blocks - and I've attempted:
if truthful
draw text XX at (x: 67 y: 102)      -- this is under my drawing department. But I don't know where (or if??) I'm supposed to put the opposite (or how)? Am I supposed to add together in an: if false, draw text?
I also tried to create a: if 2d < ten set XX to ... but I tin't set information technology to true because it's the wrong shape?
As well, aren't all my drawing events after 'Time' in i code block already? Did y'all want me to put them in a separate block??
To sum up: I'm just a tad confused over all this.


So I've had a brainwave of sorts - in that I inverse my XX from Number blazon to Text type (thinking that setting the Number to 0 may be confusing things).
Practiced news is that information technology now counts down: 0:  11, 0: 10, 0:09 --- etc.
Bad news is that every bit soon equally the time resets, the 0 just stays there again. Could someone please let me know where I should put my if - cake, so that it resets appropriately?

« Last Edit: August 28, 2019, 01:52:59 am by emanon »


See attached prototype. Use this in a drawing block to depict the seconds of your timer. Your aspect should exist just the seconds as a number. Replace "Current Minute" with your "Seconds" game attribute.


First let me tell yous: WOW [How did you fifty-fifty effigy that out ?]. Thank you so much! With that improver the seconds really look normal!
Second - every bit with near things.. I've yet got a small hiccup (or two) with the coding - Both are to exercise with the time resetting
1) When the numbers first get-go counting down, instead of reading say: one:10 (70s) it reads 0:00 (so 1:09 and proceeds as normal). It as well does this when the countdown resets.
ii) I have a separate consequence that is: When created, set Time to 11 [and then that I didn't have to deal with watching the fourth dimension count downwardly over and over]. Initially I had the time reset to 11 seconds as well (but I've now changed it to 70). However I've now noticed that the "when created" block is overriding my reset to 70s section (every bit in it resets to 70 then shifts the time to 11s). I tried merging the When Created, and Exercise Every 1 2nd blocks only this didn't modify annihilation (unless I merged it incorrect - which is quite possible).
Hrmmm. Any ideas for trouble solving hither?


Well skilful news - I realised I removed the game attributes values in attempting to get things to piece of work. Then I put Time/Timer back at value 11 (well starting value), and removed the When Created... which means my game now resets happily - mostly.
Yet haven't worked out how to get the initial number to show up.


You probably demand to set your Infinitesimal and Second game attributes in the when created outcome.


I think I've managed to gear up it! For some reason having the 'Set Minute to X', and 'Gear up 2d to Ten' in the same block as 'If Fourth dimension > 0' acquired a hiccup - not exactly sure why, but making it into its own split up event has everything working at present. :D
Thank you for your aid once more with the seconds text lawmaking - I would have been utterly doomed creating that by myself (non that I knew how/or that I needed to create information technology!).
I've attached the code I take at present - in case in that location's anything I could simplify/edit that I've missed in my current glee.
Thank you,
E


Source: http://community.stencyl.com/index.php?topic=58992.0

Posted by: sandovalmeir1997.blogspot.com

0 Response to "Can You Draw Text Stencyl That Disappears After Seconds"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel