alanziy's Forum Posts

  • I found exactly when the objects disappear. They disappear when I choose any event sheet tap and at the same time I try to change any object in the Z-Order tap. But if I choose the layout tap and try to make a change in z-order tap everything is fine.

    Here is the link of the capx:

    https://www.dropbox.com/s/28utnvhvfkn19yu/z-Oreder-Test.capx?dl=0

  • Problem Description

    Z-Order tap in the interface does not refresh when you change the order of any object. It completely hide all the objects unless if I disable or enable "Show active layers only" every time I change a Z-Order of any object.

    Attach a Capx

    No capx needed. It is an interface of C2 problem.

    Steps to Reproduce Bug

    • Step 1 Go to z_order tap.
    • Step 2 Change or move any object to change it's order in the list of the objects.
    • Step 3 You will notice that all the objects will disappear.
    • Step 4 Select "Show active layers only" (whether it is enable or disable) just switch is to the opposite, and all objects will appear again.

    Observed Result

    All objects disappear.

    Expected Result

    All objects should appear.

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    C2 V231 Beta Version.

  • You could create an instance variable for the enemies called "state" for example. When is set to 1 you set the behavior group of the enemy to be active and when is set to 0 you set it inactive. So, when enemy "Is on screen" set enemy state to 1 else set it to 0.

    Thanks anty21ro . This is a good solution. I also thought of another solution that I make a dummy sprite for each enemy and this dummy has only one function. If the dummy in screen then it spawn the enemy once, otherwise the enemy is destroyed.

    When I post my question, I though that there might already be an event that suspend the sprite if it is out of screen.

    Anyways, Your solution is better than mine since it doesn't drain the resources of the CPU.

    Thank you all guys. I appreciate your help.

  • Are you using the "Is on screen" condition in your enemies events ?

    "Is On screen" condition is used if I want to destroy the enemies outside the screen but I don't want to destroy them I just don't want them to be active if they are outside the screen.

    Please, If you have any idea on how to use this condition in this situation.

    The situation is that I don't want to destroy the enemies outside the screen and at the same time I don't want them to be active. Maybe you say that C2 is intelligent to make inactive of outside screen sprites but what I see that those enemies (sprites) are interactive even if it is outside the screen.

    Thanks

  • I don't want the way of destroying them and then create them cause each one is positioned in a certain place and the map of the platform is big. So, it is hard to create them in exact position using events.

  • Hi,

    In a platform game. I made many types of enemies. Each enemy has its own behaviors and some of them has un-regular behaviors (I made them AI) so I can't make their behaviors inactive. how can I suspend all those enemies if they are out of the screen? I notice that some of them shoots the player even if it is out of the screen. Is there an event that can make the object inactive?

    Thanks in advance.

  • alanziy

    Just a heads up - it's been well over a year since Somebody visited, so it is probably unlikely you will get an answer.

    It may be more appropriate to make a 'Request' post in the main Effects section.

    Thanks. I thought when I mentioned the member in my post he maybe able to be notified by PM.

  • Dear Somebody, Thanks for your great effects you made. Can I ask you a favor ?

    Would you mind to make a new effect then can exchange the corners positions of image, layer and layout and changes it's contents too ?

    for example, if I have a image, layer or layout with these 4 corners positions (0,0) , (200,0) , (0,100) and (200,100) and I want to change them to new position like (50,50) , (100,60) , (40,70) and (300,80).

    It is similar to skew effect but it will effect all the 4 corners.

    Thanks in advance

  • Thank you guys,

    I'll try it and see if can do the job.

    Best regards

  • In this topic is a shift effect plugin.

    I have no idea if it suits you.

    Normaly you can apply effects also on a layer.

    Thanks for your quick reply. But these effects you mentioned were so useful but they don't do what I'm looking for. What I'm looking for is an effect that can change the position of each corner of the layer to a new position and this should also change the content of the layer.

    for example, If I have a layer that has these corner points (0,0) , (100,0) , (0,200) and (100,200) and the effect should able to change them to be (50,10), (80,20) , (20,190) and (70,140).

  • Hi,

    Is there any plugin or an easy way or idea to skew a layer so I can change the positions of the corners of a layer?

    For example, I have a layer of a size of 200x100. it's corners will be (0,0),(200,0),(0,100) and (200,100). I want to change these corners positions to any other positions so the result will effect the hall content of this layer (changing the scale and positions of its contents).

    Thanks in advance

  • Thanks for the help! But either I'm not understanding this correctly or are your maths off?

    Because for 650/2, I'm getting 325.

    Sorry ... I just mistype it. It is 325 not 630.

    I just fixed it. Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are welcome my dear

  • Use these formulas:

    Jump speed = 650*X

    Gravity = 1500*(X^2)

    Max fall Speed = 1000*X

    If you want to accelerate replace X with number of acceleration greater than 1 (example 2,3,4... etc) and if you want to decelerate it use number as a fraction (less than 1 and greater than 0) (example 0.1 ,0.2 ,0.3 ......etc).