Bootfit's Forum Posts

  • You could do:

    timerBar.Width = timer*k

    where k = timerBar.maxWidth/timerStart

    k is a constant and can be calculated once at the start of the layout/round (assuming you're not changing the maximum bar width and the initial timer value on the fly).

    Can you expand on this? Not sure what you mean.

  • I've implemented a timer on my game - just a simple:

    System > Every 1.0 seconds > System > Subtract 1 from Timer

    The timer doesn't start from a fixed time though, I also have events where 5 or 10 seconds are added each round. It all works fine, but I want to replace the countdown text with a bar that decreases in length.

    So each round I'm guessing I have to set the start length of the Timer Bar (1400 pxls) to equal the current start Timer value (whatever it may be) and the end length (0 pxls) to equal the lowest Timer value (0 seconds) and on each tick tween the length of the timer bar.

    In the layout I've given the Timer Bar two variables - one called Full with a value of 100 and one called Empty with a value of 0. Is this the right way to go or is there a way in the events sheet where I can simply tween the length or width from Timer (full time) to Timer 0?

  • OK - I have a number of events that happen On start of Layout, but when the user loses all of their lives the global variables are reset and so all of the events of On start of Layout are replayed/reset when the user tries again.

    But of those events there are one or two that I only want to happen the very first time the user opens the app.

    How do I separate the two sets of events?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Anyone have any ideas on how to set the Global Number for Charms02global to the animation frame number for Charms02?

  • I've changed the names of the Sprites to Charms - so I've currently got:

    Global number Charms02global = 1000

    So if the score = 2 and the Global number of Charms02global = 1000 then choose a random sprite frame.

    Then the system should set the Global number of Charms02global to the random animation frame.

    Then when the score = 2 the Global number of Charms02global should be not equal to 1000 but be equal to the random frame number so display that frame.

    But it displays the frame for the first time Score = 2 - but after that the ? event displays just the first frame of the sprite.

    Any ideas?

  • Looks like the remote preview is only available if the QR Code window is still open.

    Can an administrator confirm this?

  • I've shared a remote preview of my game with a couple of friend to get feedback - they're now sharing with their other friends which is something i don't want.

    Is there a way to cancel the remote preview URL so it can no longer be accessed or is it a case of once it's out there it's out there?

  • Use a global variable.

    Set the random value (0 to 5) to that global variable.

    When your score is > 2 set the displayed frame to the value of the global variable.

    On start of layout, if score is >2 set the displayed frame to the value of the global variable.

    The global variable value won't change when the layout restarts.

    Can you expand on this?

    I've tried entering choose(0,1,2,3,4) into the associated global variable but it will only let me enter it as a string - will this resolve as a number?

  • Again this makes it pick another random frame once the layout reloads.

    Wonder if I’m better off having one image per sprite.

  • Don't choose a random animation on start of layout. Set the animation frame in the same event as you set the sprite visible if you don't see it until that point. So your bottom event looks like if score >= to 2 set animation frame to choose(0,1,2,3,4) and then set visible.

    Yep I've tried that:

    Global number Sprite01 = 0

    Events...

    System > Score = 2 > Sprite01 > set animation frame to choose(0,1,2,3,4)

    System > Score = 2 > Sprite01 > Set Visible

    ...but the sprite just displays and rapidly scrolls through all the frames.

  • Ah, hang on - I've spotted a problem.

    The animation frame is chosen and displayed after the score goes above 2 (score > 2) and then the layout resets.

    But when the layout restarts, the chosen frame is then replaced by another random chosen frame, rather than the frame that was previously chosen.

    How do I get it so whatever random frame that is chosen remains chosen the next time the layout is reset?

    Currently...

    Global number Sprite01 = 0

    System > On start of layout > Sprite01 > set animation frame to choose(0,1,2,3,4)

    Events happen that reset the layout...

    System > Score = 2 > Sprite01 > Set Visible

    ...

    I need to save the selected animation frame for the next layout, similar to how the score is added to at the end of one layout and recalled at the beginning of the next.

  • Excellent!

    Thank you

  • I have a sprite (Sprite01) with 5 animation layers (0 - 4).

    I want to display a random frame from this sprite when an event is triggered.

    On the Events sheet I've got:

    Global number Sprite01 = 0

    System > On Start of Layout > Sprite01 > Set animation frame to 0

    What do I type to set animation frame to random, or is there a better way to do this?

    Thanks

  • Hi all, is it possible for Construct 3 to access Facebook contacts so a player can select a contact and (for example) import their name or other details into the game?

    Thanks.

  • OK, what am i doing wrong here?

    I thought this was correct, but all this action does is colour AnswerPanelYes/AnswerPanelNo with a greyed out red colour.

    Neither the green or red from the effects panel replace the original grey colour (34, 34, 34)

    Can anyone help with this?

    Is ReplaceColor even the right/wrong effect to use in this situation?