dop2000's Recent Forum Activity

  • Hey Ashley,

    Sorry for summoning you, could you take a look at this please?

    If this is in fact not a bug, please explain why this is happening?

    Basically, when Or-block is nested under System->Pick event, the results are unpredictable.

    Updated CAPX:

    https://www.dropbox.com/s/odcjah36sa6g7 ... .capx?dl=0

  • Just change the last line in your event #4 to this:

    barra -> Set width to (XP/XPMAX)*Sprite2.width

    You can add min() or clamp() so it won't grow bigger than the Sprite2.width:

    barra -> Set width to min((XP/XPMAX)*Sprite2.width, Sprite2.width)

  • Sure.

  • AJAX can't filter data, it will load the entire file. And you will need to find 4-letter words in AJAX data.

    How is your text file formatted?

    If it contains a list of words separated by the same symbol (comma, space, line break etc.), then it's easy.

    Use expressions Tokencount() to get the number of words, TokenAt() to retrieve each word, and Len() to check word length.

    For example - loop from 0 to Tokencount, compare each word length, if it's 4 letters, then add this word to an array.

    If the file has a different structure or contains some random text, it may be a bit more complicated.

  • divyach

    Have you actually tried any of the advice posted here? My previous comment does what you want.

    Not "exactly" like Hero Jump, but close enough. You can tweak scroll and jump speed, parallax and other values.

    Event #3 controls the scrolling, you can change it to (160, player.y), or to something like (160, lerp(scrolly, player.Y, dt*8)) if you want smoother movement.

  • From my experience:

    Don't use effects on mobile! A very simple effect applied to a small sprite could cost a few fps on an older phone. Ten sprites with this effect - and the fps can drop down to unusable numbers.

    Blend modes with "Force own texture" set on the layer can also have a noticeable impact on performance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This post is related:

  • 2. Read this article about issues with using too many global variables, it has a few good points:

    http://tobyr.wtfgamesgroup.com/c2-plugi ... variables/

    You can create groups of events and define local variables, they will be accessible only from their groups.

    You can add "temporary" local variables inside of event or functions.

    Note, that these variables don't always keep their value, so if you want them to preserve the value between calls, you should tick "Static".

    3. Instance variables are great! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> You should use instance variables whenever possible.

    You can attach instance variables to different objects, not just sprites or text. I use them with arrays, dictionaries, some other plugins.

    That Globals plugin advertised in the above link is basically an abstract empty object, used only as a storage for instance variables.

    4. Every X seconds is OK to use in some cases. If you want a better control, use Timer behavior - you can run independent timers per object, per instance, stop/restart timer.

  • Good job with the families! I know it's an annoying task converting objects to families, but it will pay off later.

    A few more things you can improve -

    If you are planning to have more allies, move pathfinding and LOS behaviors to the Allies family.

    You can disable them specifically for the player sprite on start of layout.

    Also, you can add AllyType variable, so you could use code like this:

    Allies have LOS to Enemies

    and Allies.AllyType not equals "player" -> (attack enemy)

    Same with Enemies family, you can add EnemyType if you need to differentiate your events slightly for different enemies. Say, some enemies can fly over obstacles, others don't etc.

    Regarding Reach circles - there is no point in adding them to a container without the player/NPC/enemy.

    Unfortunately, you can't add a family to the container.

    If you want to use variables instead of these circle sprites, you can try something like this:

    On every tick

    For each Enemies

    .... Pick Allies by evaluating Distance(Enemies.x, Enemies.y, Allies.x, Allies.y)<NoticeRange

    On a second thought, a much better solution would be adding several LOS behaviors, name them LOS_Notice, LOS_RangedAttack, LOS_MeleeAttack ect.

    Set different range for each behavior, different obstacles.

    Here is an example of a very simple AI:

    For each Enemies

    ...If Enemies has LOS_MeleeAttack to Allies -> (melee attack)

    ...Else If Enemies has LOS_RangedAttack to Allies -> (ranged attack)

    ...Else If Enemies has LOS_Notice to Allies -> (move closer)

    ...Else (patrol)

    Your NPC animation speed is 0, maybe that's why it's not playing. Open NPC sprite, select animation, you can change its speed in the properties bar on the left.

    It's hard to say what's wrong with your AI code as almost all events are disabled.

    I recommend you start with a simple AI and then gradually add more features to it.

  • CreativeMind

    Thanks! I'm using Solid paddle with curved collision polygon, so will need to adapt your code.

    Here is one more tip - when the ball bounces between two walls at close to right angle (85-95 degrees), it can bounce for ages, which is quite annoying. So I increase the angle a little bit with every collision. Say, if the angle was 86, I make it 83.

dop2000's avatar

dop2000

Online Now

Member since 26 May, 2016
Last online 29 Nov, 2024

Twitter
dop2000 has 250 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