Bootfit's Recent Forum Activity

  • The function I need isn't If Score%10 = 0

    The function I need is If Score % 10 = a whole number > then DO THIS...

    --> ELSE do this...

    eg:

    * 6%10 = 6 (whole number) > DO THIS...

    * 5%10 = 0.5 (not whole number) > ELSE...

    So whats the expression for Whole Number?

  • OK - so float(Score)%10 is the expression I need, but how do I complete the following:

    System > float(Score)%10 -> If the result is a whole number then do A, else do B

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Brilliant. Float - that was the term I couldn't remember.

    Thank you :)

  • In my game whenever the player gets a score of 10, 20, 30 ... 1210, 1220 etc (basically any score that is wholly divisible by 10) I want an event to run.

    There's a way in programming that runs something like this:

    If a number is divided by 10 and the result is a whole number (1, 2, 3 etc) then run this function...

    I can't remember the name of this type of function, but is there a similar way of doing this in Construct, where If Score/10 = Whole Number then execute Function

    Thanks all :)

  • Nope - completely lost.

    When I put all Lerps in the one event:

    rgb(lerp(0,255,SliderBar.Value), lerp(0,255,SliderBar.Value), lerp(0,255,SliderBar.Value))

    ...the slider just turns the background from black to white.

    I've tried adding instance variables (TestSpriteR, TestSpriteG, TestSpriteB) to a yellow TestSprite:

    system > every tick > Test Sprite > Set TestSpriteR to (lerp(255,0,0))

    ---------------------------------- Set TestSpriteG to (lerp(0,255,0))

    ---------------------------------- Set TestSpriteB to (lerp(0,0,255))

    But that didn't do anything. Yep, I've no idea what I'm doing.

  • pilpgam - thanks for the plugin suggestions but I might look into the code/event sheet suggestion by NetOne. The AdjustHSB plugin looked promising but it altered all the colours in the game as opposed to just colours on a specific level.

    Tis not advanced very basic stuff

    you really need lerp for a lot of things in games so good to understand

    here I did background RED only on one slider to keep it simple so you can see how it works

    the slider just moves value from 0 to 1 so result is it is setting red from 0 to 255

    green and blue I left at 0 but if you clone 2 more sliders and put the same lerp then you can control all the colours

    https://drive.google.com/open?id=1Rx7ysE4UydFQnvB0EmC2MWwFYY9G2FQb

    NetOne - thanks for this.

    I cloned the slider bar and called them SliderBarR, SliderBarG, and SliderBarB - then did:

    System > Every Tick > System > Set layer 0 background color to rgb(lerp(0,255,SliderBarR.Value), 0, 0)

    ---------------------> System > Set layer 0 background color to rgb(0, lerp(0,255,SliderBarG.Value), 0)

    ---------------------> System > Set layer 0 background color to rgb(0, 0, lerp(0,255,SliderBarB.Value))

    However, when I do this only the last slider bar in the event sheet works - in this case, SliderBarB. If I disable that then SliderBarG only works. Does this make sense?

    Also, once I do get all 3 slider bars working together, I'm not sure how I'll automate it so it runs through a set selection of colour points.

  • Hmm, that seems a bit advanced for my current level. Are there tutorials or basic projects that I can look at that will help clarify the process?

  • Thanks pilpgam - I appreciate your help with this. I've replicated your event sheet and I've been fiddling around with the colours but I can't seem to get the correct colours I need.

    I need the following colours:

    R 255

    G 225

    B 0

    fading into

    R 255

    G 0

    B 255

    ...and every colour between - so it passes through the green and blues also.

    Ashley is there a way to implement this easily?

  • Maybe just adding a 'Set Color' effect to the sprite and then changing the parameters of it every 0.1s and then stopping that process when it reaches for example 255, 0, 255?

    I'm not sure how I'd go about this - can anyone expand on how I'd do this?

    I've created a white tiled background sprite and I've given it an Effect of Set Colour.

    Now what?

  • Never mind - I created the graphic 25% smaller then resized it to 400% in the editor.

  • I have a sprite that is a starburst effect.

    In the 2160 x 3840 screen it's vertically centred horizontally and 3/4 the way down the screen vertically.

    The sprite extends way past the edges of the screen as its 7470 x 7470 as I want it to rotate around its centre point so the whole starburst graphic needs to be intact.

    However when I preview the project it throws up an error saying the maximum graphic size is 2048 x 2048.

    How can I get it so the graphic appears?

    Thanks all :)

  • Is there a way to create natural gradients in Construct.

    Or is there a way to have one colour fade into another colour. For example if the background layer started off red but as the game progresses it fades into a blue or yellow etc?

    Thanks all :)

Bootfit's avatar

Bootfit

Early Adopter

Member since 3 Sep, 2017

Twitter
Bootfit has 2 followers

Trophy Case

  • 7-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies