Voskard's Forum Posts

  • 11 posts
  • here mate if you still need it i made a easy to follow enemy creation /destroy and platform movement for u cheers.... people here tend to overreact with their coding .... when even isn't needed

    Hey thanks!! Awesome man!

  • This kind of depend on your design. But from what I get from looking at the game, you have the line in the middle and to this there are linked two other objects to the end, which if the player touches them they kill hims. So you could do it, so when you create the line and the end points, you store the UID of the line as a variable in the end points.

    > 
    Create Line
    
    Create End_point_1
    Set Parent_UID = Line.UID
    
    Create End_point_2
    Set Parent_UID = Line.UID
    
    On Collision Player with line
    Pick End_point_1.Parent_UID = Line.UID
    Pick End_point_2.Parent_UID = Line.UID
     [/code:2mnusz9n]
    
    This way of doing it is not really the best way of doing it, but since you don't use families etc. and I guess you are fairly new to C2, if im not wrong, then this way is probably the easiest and then you can always change it later.
    

    Thanks for the help!

    Yes, I'm pretty new to C2 haha

  • I've been trying a lot of different things and I still can't get it fixed

  • You have a picking problem, when the player collide with, for instant "Barritaentera" you destroy "Barritalzquierda" and "BarritalDereccha" as well. (Sick names btw ) But you never pick which of these to destroy, so it just automatically pick all of them and then destroy them. You have to pick the correct ones of "BarritalDereccha" and "Barritalzquierda" as well, and the same goes for all of your "On collision" events.

    Ohhh ok! And how can I pick which ones I have to destroy? Thanks for the tip btw

    Regarding the names, haha they're in spanish as I am spanish!

  • Here it is!

  • Hello everybody! I'm still not able to fix this, I don't know why it's doing it!

    If you guys want I can post the capx file

  • you cant have more then one destroy events for the same object after the first one the object that the is associated with the condition get destroyed first then the next is making the rest get destroyed. unless those are other objects and we just cant see.

    Yes, those are other objects but since I'm testing if they destroy or not I painted them with a red color (normally they're transparent).

  • How is the player destroying the enemies? You can give the destroy event some condition to tell construct what enemy you want to destroy. Are you using a trigger?

    Post a screenshot so we can see how you set up the events.

    Hello!

    The player destroys the enemies when the player touches them. The enemy is a line (for now) and at the end of every side of the line there's 2 sprites that when they touch the player they kill it.

  • Hello everybody!

    I've set an event so that every 2 or 3 seconds an enemy spawns. The problem is that when the player destroys one they all die (even if there's like 5 on screen).

    How can I fix that?

    Thank you in advance!

  • This should go in the How Do I forum.

    There are a few ways to handle these sorts of situations. The way I do it is with an invisible dummy object, let's call it a spawner. I create the spawner(s) wherever I'd like my objects to spawn, and then spawn the spawner there instead. Next is to check if it's overlapping the player/obstacles/walls/etc. If it is, destroy it. Then create a function for the spawner to create your object.

    I'll try that now and see if that works!

    Thank you so much for the reply!!!

    EDIT: It works!! Thank you GeometriX!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello everybody!

    I've been googling this problem for a while but I haven't found a good easy answer.

    I just started using Construct 2 and I'm making a game where some triangles spawn and when they touch the player the health of the player decreases. I've set the triangles to spawn randomly but sometimes they spawn on top of the player, making the game end quickly. How can I make this bug go away?

    I can send screenshots if needed

    Thanks for the help!!

  • 11 posts