frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

How to add a rain overlay to my game, save troubles, and object following player mechanic.

edited January 7 in How To
Hello again everybody.

Here is the game I'm working on https://flowlab.io/game/play/786820

Basically, I need to overlay a loopable rain effect into the game as I have rain sound effects in the game, but I'm not sure how to go about that.

I'm also having trouble understanding how to save feature works, I've added a thing into the game that notifies the player that the game is saving, and I think I've made it so the game does save, but I'm not sure how to actually load that save.

Lastly, I have this cloud that follows the player 10 seconds after you click "Start" and it's supposed to float around the player and follow the player, but when it hits the Y-axis perfectly is jitters back and forth, and then when it (i think) hits the x-axis it also jitters back and forth. Could I set a radius from the player that the cloud cannot enter?

Thanks again everyone. :)

Comments

  • For the rain, an emitter would probably be your best bet - just drop them in from the top of the screen maybe.

    To eliminate jitter, maybe try using an easing formula to move the cloud slowly to the target position. Here's an example of what I mean: http://flowlab.io/game/view/787750
  • Sweet, thanks!
    FlowLab user just trying to make the best games for all devices SIMPLE!

    Grazer I have good ideas in the "future requests" tab!!!
  • edited January 8
    @grazer For the easing formula, that seems to work but I've never seen or used expressions in that way, so I'm not sure how to slow down the movement of the object following the player. Also, without the filtering, I'm not sure how to make the object flip depending on the x and y axis.

    Edit: So I figured out the speed, but I don't want it to go on top of the character. I've heard the proximity is a bit finicky, but maybe I could use it somehow?
    FlowLab user just trying to make the best games for all devices SIMPLE!

    Grazer I have good ideas in the "future requests" tab!!!
  • I'm also new to the emitter behavior, I've attempted to use it before but I don't fully understand how it works. I get what it's meant for though.
    FlowLab user just trying to make the best games for all devices SIMPLE!

    Grazer I have good ideas in the "future requests" tab!!!
  • Maybe if you describe the behavior you're looking for in a bit more detail I can offer a better suggestion. If the cloud follows but does not converge directly onto the player, where does it go? Above his head? To his left or right?

    As far as the flip goes, you could use a filter the way you do now. If you wanted to slow down the movement in the formula, use a smaller percentage. The easing formula is useful for all kinds of stuff, and it works like this:

    (target_value - current_value) * percent

    This means if you used 50% (or 0.5) then the cloud would move half-way from its current position to player every frame. This means that the farther away it is, the faster it will move, but as it gets closer it slows down, which makes for a natural looking movement. Anyway, the smaller you set the percent value to, the slower it will move.
  • There we go. I tweaked the numbers a bit and got it how I needed. I just need to figure out this emit behavior :/, I think I’ve got it.
    FlowLab user just trying to make the best games for all devices SIMPLE!

    Grazer I have good ideas in the "future requests" tab!!!
  • Save is an easy behavior to learn.

    You input a number into SAVE, and it assigns the name the behavior is set to to that number.
    You input into READ, it remembers what you inputted into save. If you haven’t inputted into save before, it sends out 0 by default.

    If you have inputted into a different save behavior set to the same name- it will affect all other Saves with the same name (but they won’t output until prompted to)
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch