dop2000's Forum Posts

  • You do not have permission to view this post

  • It's not recommended to use Physics together with other non-physics behaviors, but it's possible if you do it with caution.

    If you are using Platform or similar behavior to move an object, make sure that Physics behavior on this object is disabled. And when Physics is enabled, disable Platform. Don't move objects with enabled Physics using non-physics methods or by changing their position directly (like "Set X", "Move at angle").

    .

    Pathfinding plugin doesn't work well in platformer games, it's better suited for top-down view. Making enemy AI in platformer can be a tricky task, you can search the forum for some examples, try these links:

    construct.net/forum/construct-2/how-do-i-18/-how-do-i-frequently-asked-que-41236

    scirra.com/store/royalty-free-game-templates/super-platformer-ai-2462

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See how the "On Turret2 shoot" event has a little green arrow on it? This means this is a triggered event. Try not to put triggered events nested under some other events, they should always be at the top-level!

    So try changing your code to this:

    Cannon1 On Turret shoot
     Cannon1 has LOS to Cyborgs -> Cannon1 spawn CannonFire
    

    The cannon will follow cyborgs, but only fire at them when they are in sight.

    .

    If you want your cannons to ignore targets that are behind obstacles, this becomes more complicated. In this case you should remove "Add target" action and use "Acquire target" instead. "Acquire target" assigns a specific instance of the enemy object to the turret.

    So your code could be something like this:

  • Maybe this has nothing to do with Construct. Open the Task Manager, Performance tab, see if there are any sudden spikes in CPU utilization.

  • Yeah, this code makes no sense, but it's working as it's supposed to.

    Pigs (Pig2 sprites) are moving in arcs because pathfinding is clashing with bullet behavior. If you disable Bullet, Pig2 sprites will move straight to the first instance of Family2. (Since there are multiple Family2 instances, an instance with the lowest UID is used as pathfinging target in event #7).

  • After you upload it, use "img" tag:

    [img=4172]

    Here is your image:

  • I think you should use TileMap.

    See this example, it's the same principle:

    dropbox.com/s/8zap7yuhwdb0pcb/Farming_TileSet.capx

    dropbox.com/s/r1em8npglbdsoeg/Tilemap_Bitwise.png

  • Not unless you have other events or behaviors preventing this.

    Why don't you just share the capx? We'll be able to tell you how to fix it straight away.

  • nicmic

    Well, like I said - check turret properties, compare them with the template. If this doesn't help, please share your capx.

  • So what's wrong - does it turn? Does it fire?

    Check turret properties - rate of fire, initial state, range etc.

    Open the default template for turret (File-New in Construct and type Turret) and compare settings with your project.

  • Are these sprites? I suggest using TileMap object.

  • What exactly are you trying to achieve?

    Angular velocity is the speed of rotation. And density is basically mass of the object. Adding them together makes little sense.

    I'm guessing you need normal (linear) velocity. You can use VelocityX if your ball is moving horizontally, or this expression to get its overall velocity:

    distance(0, 0, Ball.Physics.VelocityX, VelocityY)

    Also, you should probably multiply velocity and density together, not add them.

    .

    Add a text object to your layout and print the result of this formula to see what numbers it's generating.

  • Angular velocity value can be negative, add abs() expression.

  • Well, if the screen will only change between portrait and landscape, you can create an event "Browser on resized" or "Browser is portrait/landscape", where you reposition all physics objects relative to the new screen dimensions.

  • Yeah, you can't abuse physics objects like that..

    I'm not sure what you can do to prevent it. Maybe add another event - if box is not on-screen, return it to the center of viewport.

    But it's really not recommended to change position of physics objects using non-physics actions or behaviors.