dop2000's Recent Forum Activity

  • You can change the size of your TextBox, but as for the word wrap - not sure if it's possible. Maybe with CSS?

    Use TextHeight and TextWidth expressions of the Text object to get actual text dimensions and resize the Text object accordingly. The only problem is that the system needs at least 1 tick (or longer for web fonts) to render the text before TextHeight and TextWidth become available.

    So it works like this:

    TextObject set Text to "Hello world!"

    Wait 0

    TextObject set Width to (Self.TextWidth+5)

    TextObject set Height to (Self.TextHeight+5)

  • Run your game in Debug Mode (Ctrl-F4)

    Find Score_Soldier in the list of variable and see what happens with it, what value it holds.

    Also just as an experiment change you action to Score_Soldier_Text -> Set Text to "1234567890"

    See if this sprite font object can display numbers.

    If nothing helps, please share your capx. It's impossible to find the problem with just your screenshots.

  • Are you saying that all blue boxes have the same FallSeconds value?

    I really don't like using events like "Every x seconds" and "Trigger once" inside of the loops.

    Try removing "trigger once" and move "Every 0.1 seconds" above the "For each" loop. See if it fixes the problem.

    If not, I suggest you enlarge your text field and add some debug output to the loop (because "Cursor is over sprite" is not a reliable method).

    So you can do something like this:

    Every 0.1 second
    For each Egg_collisionCheck    Text append newline
       cos(....)>50  Add 0.1 to FallSeconds
                     Text append "ID:" & Egg_collisionCheck.IID & "+0.1=" & Egg_collisionCheck.FallSeconds &"  "
       Else          Set FallSeconds to 0
                     Text append "ID:" & Egg_collisionCheck.IID & "reset  "
        
    [/code:2qembwov]
    
    This will help you to understand what exactly is going on.
  • If only one effect can be active at a time, then your approach is ok. I would've done it the same way.

    I think you can optimize it by changing your event 104 to "SliderBar On Changed", then you will be able to move "Call FxOff()" to this event 104 and remove it from all sub-events. Also you could remove all "Trigger once" conditions.

    You can also make a file (CSV or XML) with the list of values, corresponding effects and their names, then load this data into a dictionary etc.. But for 20 effects this would probably be an overkill.

  • Mixing platform and physics behavior in one sprite is a bad idea.

    My guess is that there are two sprites in that youtube video - the character sprite with platform behavior, and also an invisible sprite with physics behavior which follows the character copying its movements.

    Character makes all the platform stuff - running, jumping etc. And the invisible physics sprite interacts with physics objects - pushes, knocks etc.

    But this is only a theory and I may be wrong.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So you have 1000 frames with different heads? Why don't you split them into 100 different sprites with 10 heads each?

    Keep all these sprites on a separate (unused) layout, so that they are not loaded automatically.

    Add all 100 sprites to a family, say "HeadFamily".

    Then on start of your game layout create an instance of the sprite with the head you need.

    For example:

    System Create Head58

    HeadFamily Set animation frame 3

    This way only one sprite with 10 frames will be loaded into memory.

  • No, as far as I know, LOS behavior only checks if target object is visible or not. And it only tests the target's origin point, not its collision polygon or bounding box.

    So to find an intersection point with an obstacle, you need to use the code I posted in my previous comment.

  • Here are two ways to achieve this

    Edit: Just noticed a mistake in my screenshot - axis(0,4) is obviously wrong, replace it with axis(0,0)

  • Here are a couple of ideas - if your low height obstacle sprites are relatively small, you can add a 3rd LOS with very narrow angle of sight. Rotate your AI towards the target position, then use this LOS to check for any low height obstacles in that direction. If found - move AI to that obstacle.

    Or you can do it with a loop like this:

    dist=Distance(ai.x, ai.y, target.x, target.y)
    progress=0
    
    While
    dist>=progress
         System Pick LowObstacleSprite overlapping point (lerp(ai.x, target.x, progress/dist) , lerp(ai.y, target.y, progress/dist))
               //  point of collision with LowObstacleSprite found, you can move your AI to it
               Stop loop
         Else
               Add 5 to progress    // 5 is to minimize the number of overlapping checks for better performance. 
    [/code:34sgjorq]
    
    This code basically moves a virtual point from AI to the target, checking if it's overlapping LowObstacleSprite every 5 pixels.
    It should have almost no impact on performance, unless you have lots and lots of AI objects and executing this code for each of them on every tick.
  • Pandy

    Check this post, it may be relevant.

    I posted a few examples there where I perform hundreds of overlapping checks per tick and the impact on performance is quite small. According to Ashley, overlapping checks in C2 are well optimized.

  • Lordshiva1948

    It would be nice if you read posts (not just the title) and other people's comments before answering.

    This post has nothing to do with LAN preview.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 247 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x4
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • 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
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies