dop2000's Forum Posts

  • newt

    If I understand your method correctly, it will distribute sprites in 10px intervals. I don't want this.

    See my picture above - one sprite may be at x=8, another at x=21 etc.

  • Nice work, mate! That was really fun!

    Would love to play the full game.

    Is there any way I can interact with the ladies?

  • Hey guys!

    I'm looking for an algorithm to randomly distribute sprites on the line.

    Let's say the line length is 100 px, and each sprite is 10 px wide.

    Number of sprites can be different, from 1 to 8.

    Sprites can touch, but not overlap.

    It's not a problem to distribute 4 sprites, but with 5 or more it's possible to run out of free space if I just place them randomly.

    Seems like an easy task, but I can't figure it out.

  • Try this:

    Add a special character to each letter in the string that you want to be yellow:

    myText="Hello, ^J^o^h^n! How are you?"

    Then parse this string character-by-character and when you find "^", read next letter and wrap it into {color} tag:

    H
    e 
    l
    l
    o
    ,
    
    J[/color]
    o[/color]
    h[/color]
    n[/color]
    etc.[/code:cpf80vsm]
    
    [quote:cpf80vsm]is there any way to change the plugin of my texts
    
    If you need to replace lots of text objects, you can edit XML files of the project, as described [url=https://www.scirra.com/forum/viewtopic.php?f=147&t=196534]here[/url], but it's not recommended.
  • Line of sight is just a condition. You can simply choose not to use it in an event.

    Or you can do something like this:

    As for the range, there is an action "Line of sight Set range", or you can compare distance between objects:

    System->Compare two values-> Distance(enemy.x, enemy.y, player.x, player.y)<=MaximumRangeToFire

  • what if instead of a background I wanted to make a foreground with enemies and platforms

    You should be more specific.

    Do you have something like this in mind?

    Subscribe to Construct videos now

    I guess you can use my example, define different collision polygons for each frame, add some image points. Then pin different obstacles to these image points.

    Or do you want to make an endless scrolling platformer game with character running/jumping/shooting etc? For this type of game there is a template in C2, see Zion's comment above.

  • You should use one of the behaviors -

    Bullet is the easiest, but it may not be good for this task.

    Pathfinding - mostly used if your path has obstacles, but it can also move in straight line.

    Custom movement - a bit too complex.

    External plugins:

    MoveTo - easy to use, possibly the best for this job.

    LiteTween - also great, especially if you need easing effects.

  • Let me google this for you <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    https://www.google.com/search?q=constru ... ll+plugins

  • You may have an error in your code.

    Could you share your capx, or a screenshot of the event sheet with saving/loading events?

  • It's possible with external plugins, here is the full list:

    One plugin that definitely does that is BBcode Text:

  • Hmm, I posted link to the capx, have you tried clicking it?

    It's not a complete game of course, just a demo showing how to do endless scrolling.

  • > Simulate Jump needs to be called every tick.

    >

    Why? On my .capx work without

    You have "Is in touch" condition. The system checks it on every tick and if true, "Platform simulate Jump" is executed.

  • Oh, then use "Is in touch" or "Is touching".

    Not "On touch start" or "On touched object", as these events are triggered only once. And for the jump to be sustained, Simulate Jump needs to be called every tick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, it works. Just use "Key is down" condition (not "On key pressed") with Simulate Platform pressing Jump.

  • You do not have permission to view this post