rofl_mao's Recent Forum Activity

  • When the objects is right next to the player, it stays there until the player repulses it. Your assumption is right.

    Let me read about lerp and try your guide, I'll tell you the result later tonight. Thanks

    Edit, if I am not mistaken, the last part

    clamp(1-(distance(hero.x,hero.y,enemy.x,enemy.y)/maxdistance),0,1)[/code:1pp4t9yt]
    
    Finds the distance between the hero and enemy compared to its maximum distance. Basically this ensures the closer the enemy gets to player, the stronger the repulsion force is. 
    
    And if I am not mistaken, lerp is used so that we always have the repulsion force set between the minimum and maximum value we wanted. Am I correct?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've been looking at construct for months, but this is the first time I actually tried something different than the tutorials.

    In short, this is what I was trying to make: A Zelda-esque game where to defeat an enemy you need to pull them with a wand and repulse them into a wall/other enemy.

    This is how the mechanic goes:

    1. Clicking on an enemy will pull the enemy towards you.

    2. As long as you hold your click, you can still move and the enemy will still be drawn into you.

    3. When the click is released, the enemy is repulsed into whichever direction you were aiming. The repulse power is inversely proportional to the distance between you and the enemy when released -- that is, the closer the enemy is to you, the more powerful the repulse power is.

    However, I barely managed to complete the first step. When I clicked an enemy it is drawn to me (using setForce) but I am clueless on how to make the enemy keep drawn into you while you hold the mouse click.

    I kinda get the concept (as long as an enemy is drawn to you AND LMB is down, pull the enemy towards you) but I don't know how to apply it in Construct.

    Thanks in advance

rofl_mao's avatar

rofl_mao

Member since 19 Apr, 2011

None one is following rofl_mao yet!

Trophy Case

  • 13-Year Club

Progress

13/44
How to earn trophies