KryptoPixel's Forum Posts

  • It depend on the image point of the object to be spawned.

    Create Object

    X: ViewportLeft("layer")-(ViewportWidth("layer")/2)

    Y: ViewportTop("layer")+(ViewportHeight("layer")/2)

  • You probably want to work out a steering/flocking system instead of using physics.

    The most simple one is to use two bullet behaviors on your sprite, and add your sprite to a family.

    The first bullet behavior is a constant speed, 0 acceleration, with angle set towards your target.

    The second bullet behavior is a 0 speed, small acceleration, disabled by default.

    On sprite overlap family, set bullet2 to enabled, and set the angle to angle(family.x,family.y,sprite.x,sprite.y)

    Then on sprite not overlapping family, set bullet2 speed back to 0 and disable.

    You can improve this by adjusting the (repulsion) acceleration based on distance, rather than simply overlapping.

    This just got me.. 2 bullets.. I didnt know that was possible to have 2 bullets behaviors on the same object.. Im gonna try it, thanks!

  • Hey guys, so, my project is room based, each room has colisors (red).

    The enemies are moving using physics, the only way that I found that moves the enemies like vampire survivors, without overlapping them.

    When the player attacks, if he attacks an enemy, the enemy got a knockback effect, where now he move at angle to a specific force*dt like the image.

    The problem is that I could not find a way to prevent enemies from overlapping the room colisors, even changing the move to angle for apply impulse.. Sometimes it works, sometimes the enemy just overlaps and get stuck there..

    Can anyone help me?

    How the Orc knockback works right now:

    Is overlapping attack_colisor -> trigger once -> Orc.Timer.Knockback Start

    Is Orc.Timer.Knockback running -> Set Orc.Physics.velocity = 0, Move Orc at Angle: angle(player.X,player.Y,Self.X,Self.Y) distance: playerKnockbackStrength*dt

  • Getting better

  • DiegoM thanks, will try it.

    Best working and best performing solution I had found for Vampire Survivor like enemy behavior is using phyics.

    Threw together a little example for you:

    https://drive.google.com/file/d/17eszXFnrcgYShboEL64XVV1iuEX70yWj/view?usp=sharing

    Let me know if this works for you! :)

    Wow thats awesome, I have tried using physics but could not manage the hits between enemies. I'm gonna try to implement this way you sent. Thanks!

  • Im doing something similar right now.

    Im using 9 positions(Image points) around the player as move to points, but they are calculating the closeast one to go to, to avoid an enemy trying to go through the player to reach the destiny.

    But as far as I move the player they all will get the same point to move to.

  • If i'm remember well, ennemis move as Bullet in Vampire Survivors, so it's pretty easy, just use Bullet Behavior, and set the angle to angle of your Hero.

    Better, but they still overlap.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey guys, Im trying to recreate the vampire survivors enemies movement.. but Im not able to recreate it.

    Using move to.. lerp and so on.. it just overlap the enemies and the player. Even them having solid behavior and colision enabled.

    Tried using path finding but it get really buggy.. Does anyone have any clue?

    Thanks

  • > Really hard to tell from the little information.

    > Having lots of objects, especially if they run complex logic, for example collision checks, for each loops etc will be very costly to performance if not optimized thoroughly.

    > Are you sure the performance problem is not based on the sheer amount of bullets and events?

    >

    > As you say the problem is recent, does the project run better in a old version of c3?

    >

    > Secondly could you send a simple project file that has the problem so I can investigate?

    I am sure its not because of the amount of bullets simply because it worked fine before, even in very old projects. ill be working on a file to send. How can i try an older version of construct 3 btw

    Open: editor.construct.net/r281

    for example

  • Glad that you found a way, let me share a way that could help.

    First, how long it takes to go from sunny to fully dark? In my example, lets say 2 hours.

    So, at 5pm it will start to go darker till 7pm when it is fully dark. (From 0 to 100% opacity).

    I would do something like this:

    On 5pm set stage to -> sunset

    Is stage = sunset and sprite opacity is not equal to 100%:

    Every 1 second set sprite opacity to self.opacity + 0.83 (0.83 because we have 2 hours in 120 seconds, so 100/120).

    What will happen is: at 5pm it will start to change the opacity 0.83% every second till reach 100%. You can also do the same for sunrise, inverting the opacity. If you want less time or more time on the process, just calc 100/seconds you want.

  • Sorry, nevermind..

  • You dont need this global variable.

    Sprite1 on Destroyed:

    For 1 to int(random(1-5)) -> System create Sprite2 at random(x,x) / random (y,y)

  • while

    number=38 -> set value to number: int(random(41))