caiorosisca's Forum Posts

  • My idea was something like OddConfection said, having a variable that only goes up (you might need to check if the player vectorY is positive so you don't add negative values to the variable, not sure if speed is negative when going downards).

    Imagine it like this player speed is 10, variable starts at 0, you add te speed(10) to the variable, scroll camera to the variable. On next frame camera will be at position 10, that keeps on going until you start falling, Imagine you kept it going until you reached 100 height, if you don't subtract values from that variable it will stay at Height 100, then you can check if distance between playerY and cameraY is greater than X value to check if he died.

  • Just a quick tought, have a variable like cameraHeight, as the player goes up, add the player's speed to that variable, (never subtract from that variable) then set the camera to scroll to that variable on the Y axis. I think you get the idea. You need to check if that works.

  • Ok, my solution is to have ObjectA creating a new object (ObjectB) at it's own position, then destroying itself.

    Create an event that checks for ObjectA.X < 293, for actions choose ObjectA > Spawn another object> select ObjectB, choose the layer you want, and leave 0 on the image point box.

    Next action is ObjectA > Destroy.

    Another alternative, I'm not sure if that works in your case, is to only change the Sprite's animation frame (in case the objects are only visually different)

  • I'm not sure on what you are trying to achieve here, I can't really see how animating sprites can be replaced by spawning/deleting.

    My thoughts:

    1- Spawn/Destroy, if you are going to spawn 72 objects in 1 frame, that may cause a significant fps drop depending on the objects.

    2- Having 72 sprites on the screen is quite a bit of sprites, if you have collisions or another interaction between them, could be a problem.

    3- Animating? I don't really get how it can solve your problem, do you mean moving them out of sight?

    It's hard to tell you the best way without further details on the project, maybe a little more explaining or some screenshots may help.

  • x < 293 ? a > spawn another object "b"

    a > destroy

  • Check this topic

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I never used the boids plugin before.

    Since your capx needs a 3rd party plugin for it to work you should provide a download link for it, most of the people on the forums won't install a 3rd party behaviour just for helping you out, mainly if you don't provide a source for it. Btw you should contact the plugin's creator to check if both behaviours that you want will work together.

  • I can't fix it for you now, but here is my tip. Start using subevents, your events are probably conflicting. Think of what is more important first and start sub dividing the other events. For example..

    |-PlayerDectect (x) is moving > Add stamina

    |

    |_-Else

    | |_PlayerDetect is on floor

    | | |____- PlayerDetect is Running > Subtract Stamina

    | |

    | |_ Else

    | |___ PlayerDetect is Falling or is Jumping or is WallGliding > Add stamina

    Another tip, don't update the width of the stamina bar directly, create a variable for stamina and add and subtract values of that variable, then update the bar's width based on that variable

    bar set width to maxBarWidth * (currentStamina/maxStamina)

  • You do not have permission to view this post

  • I haven't read the whole post, but someone asked for a similiar (if not identical) thing a few days ago.

    Check if that helps.

  • I'm not good at maths either, but I think that is the formula your are after. Give it a try, if it doesn't work search for the equation of the line

    vol = (greenBox.width*100 + -100 * abs(Player.X - LayoutWidth))/-greenBox.width

  • volume = abs(Player.X - LayoutWidth) / greenBox.width

    Grey is layout size(pretend it on my img).

    Blue is at the position where it ends, represented by LayoutWidth.

    using this formula when the player is at the left side of the greenbox (this is the region the player needs to be inside for the volume to fade) volume will be 1, and when at the right side volume will be 0.

    Note, volume will be 0 exactly at the end of the greenbox, where the blue line is. if the player moves further to the right volume will start going up again. so it's important that it is at the end of layout.

    http://imgur.com/jtUyw76

  • if you are setting the position manually, you need to also check if it's over a wall, after moving the boss, have another check for if the boss overlaps a wall, if so, either move it back or move it somewhere else.

  • volume = distance from player to end of layout / distance between player and end of layout to start fading.

    You can use an invisible object to control this distance and use it's width when calculating