oosyrag's Recent Forum Activity

  • I don't believe there is a way to do this.

    You can overwrite a save though.

    Any specific reason you need to delete a specific save state?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are a few ways to do this. Any LOS check will use collisions. You can use a raycast/LOS function to see if your LOS hits a solid part of your tilemap or not, and get the layout x/y position and use that to get tile index position and ID. This will only allow you two classes of specific tiles though - solid or not solid.

    A workaround is to layer some invisible tilemaps and paint solids where you want them to collide, then you can differentiate which tilemap you are hitting to do different actions.

    A third way is to draw invisible placeholder sprites with LOS behaviors. This way is probably the simplest if you don't have very complex shapes or very large maps for collisions, as you won't need a custom LOS function.

    For your array question, if you don't want to check every cell, use a nested System "For" loop.

    Conditions

    For "x" from a to b

    --- For "y" from a to b

    Expression

    Array.At(loopindex("x"),loopindex("y"))

    Edit: As for performance impact, I'm actually not sure if there is any different between this and for each x/y with additional conditions such as x>a and y<b or something like that. It is something you can test pretty quickly - if there is a noticeable difference let us know! If you can't tell if there is a difference, don't worry about it.

  • For pin behavior, try using debug to confirm you are pinning to the correct object instance, picking instances can sometimes get tricky when referring to the same object.

    Once you have pinned one to the other, you no longer use actions to move the pinned object. When you move the object it is pinned to, both will move.

    In this situation though, you probably don't need the pin behavior at all. As both edges of your platform are the same object with different animation frames, an action that makes that object move should move both/all instances of that object at the same time. Just make sure the ones you want to move are picked correctly with conditions.

  • The official answer is... don't worry about it!

    https://www.scirra.com/blog/83/optimisa ... -your-time

    If that is not satisfactory, this post has a little more details about what really does matter in terms of performance.

    https://www.scirra.com/manual/134/performance-tips

    On a side note, I'm going to guess that maybe you are misunderstanding the "For Each" and "Else" conditions, so I'll leave these here for your reference just in case you haven't read them yet.

    https://www.scirra.com/blog/141/common- ... nd-gotchas

    https://www.scirra.com/tutorials/292/gu ... t-features

  • Add "System - For Each PlayerSprite" in your condition.

  • Try adjusting the period offset as well - it adjusts the starting point of the motion.

    If it gets confusing, try disabling one or the other sine motion to isolate just the left/right or up/down motion first to get the amount you want to move right first, then adjust the offset with trial and error to sync them correctly.

  • Oh sorry you're right, you can't make a global variable boolean. In that case just make it a number and add 1 to it.

    Variable = 0
    
    On Start Layout   |  Action - Do Something
    If Variable = 0   |  Add 1 to Variable[/code:8nymgku8]
    
    Now that Variable is 1, that event will no longer run again even if you come back to your layout a second time. Unless you reset Variable to 0.
  • Did you download the capx I linked to in my previous post?

  • Even if you have scroll to on your main character, you can add additional scroll to actions that run conditionally after that one.

  • Global variables are persistent and can be referred to in any layout.

    The persist behavior can be used to save or keep track of objects' information while switching back and forth between layouts.

    Arrays are also persistent through layout changes and are an excellent way to keep track of structured data.

    On start of layout will occur any time that layout loads. If you want it to run once only, use a variable (for example a boolean called "FirstLoaded"), add a second condition to your start of layout event to check if "FirstLoaded" is false, and add an action in that event to set "FirstLoaded" to true. After running the first time, the variable will be true and that event will never run again even if the layout start triggers again.

  • (On Event) - Set Variable to round(random(100))

    (Sub-Events) -

    If Variable < %chance - Do Thing1

    Else if Variable < %chance - Do Thing2

    Else if Variable < %chance - Do Thing3

    ect...

  • Try using a bullet behavior on the sprite, default 0 speed/gravity.

    Condition: Sprite on collide with Player

    Actions: Set Sprite bullet angle of motion to angle(player.x, player.y, sprite.x, sprite.y) //Maybe +180, I forgot if this will angle towards the player or away from the player off the top of my head.

    Set Sprite bullet speed to 200 //Or whatever initial speed

    Decay bullet speed:

    Condition: Sprite bullet compare speed > 0

    Action: Set Sprite Bullet speed to floor(sprite.bullet.speed/2) //Eased out deceleration, you can use sprite.bullet.speed-20 for linear deceleration for example. Best practice might be to add max(0,x) expression to constrain the speed so it does not go below 0.

oosyrag's avatar

oosyrag

Member since 20 Feb, 2013

Twitter
oosyrag has 38 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

21/44
How to earn trophies