Nabu's Recent Forum Activity

  • There are plenty examples here https://www.scirra.com/forum/how-do-i-frequently-asked-questions_t63692.

    Here is a little one. I can show you more if you want. Click on the conditions and actions and "back" to see how I've went to it.

    https://www.dropbox.com/s/thov38l6678eyl6/example.capx?dl=0

  • You can have two object types with same graphics and variables / behaviors. One being set as an obstacle to the line of sight, the other not. So when a tile is or become higher than the player, destroy it and create the same but of the type that blocks line of sight. You can encapsulate everything in function to make it clear.

    And maybe you'll be interested in ray casting (search in forums) for testing if player has direct line of sight to something. It can be customized (customised ?) to collide with what you want and thus have different kinds of obstacles.

  • There is no "facing" condition. You have to check wich animation the player is actually playing if you have one for to go left and one for right.

    Add a condition, select your player, under "animation" select "is playing" and the animation you want. For example, if animation "left" is playing, then shoot left.

    I can make you a little example for these kind of tests.

  • Of course, when the player shoots (I don't know your implementation, maybe post your project, or a simple one), I imagine you do the action "player => spawn bullet, or system => create object Bullet at Player.X Player.Y", just after this line in the editor your click on "Add action" and "bullet => set angle of motion to Player.Angle".

    In the editor you can quickly retrieve variables (like "Player.Angle" from objects with the little window that opens when you create or edit an action or condition.

    Or if you game is a plateformer, barely the same : spawn bullet, then create a condition "if player is facing left (by testing its angle or animation) => set bullet angle to 180 (left)", create an "else" condition and "set bullet angle to 0"

  • Yes, and the Pin behavior has nice effect like "hook" or "bar" to follow your character.

  • Hello,

    Here's things you can do :

    • use a boolean instance variable for your object, setting it to false when it dies and check for it when interaction. So during any interaction action, if it's dead, do nothing. It does not reduce the amount of object though. You can also disable collision for the object so it does not trigger anymore and saves a bit of cpu.
    • Using the Paster or Canvas plugin, maybe you can create a paster on a layer, the size of your layout and paste on it the sprite when it dies and destroy the object. But you can do no interaction with the dead object after this.
  • Hi,

    You cannot specify witch object to be an obstacle for LIne Of Sight behavior (as well as Pathfinding behavior), but only object type or entire family. The "add obstacle" action applies to all instances, it's construct 2 built in.

    So depending on what you want to achieve, you'll have to avoid this.

    Maybe you can tell more about your project and we can find a solution.

  • Hello,

    Maybe you can post a simple .capx so we can see your implementation.

    However, when you the player shoots you can give the bullet its angle :

    • Spawn bullet at player
    • Set bullet angle to player angle

    Or

    • If player if facing left
    • Set bullet angle to 180

    Else

    • Set bullet angle to 0

    Depending on your type of game. If you use the bullet behavior, setting the angle of object might does not be enough and you'll have to set the bullet behavior angle of motion instead, (if bullet behavior set object angle to angle of motion property is unchecked).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    Physics behavior bug / crash when creating objects on the fly

    Attach a Capx

    https://www.dropbox.com/s/et90z0zdwswqepe/physics_bug.capx?dl=0

    Description of Capx

    Simple layout with physic objects. Left mouse click to spawn coins high rate.

    Steps to Reproduce Bug

    Just spawn some objects with left mouse click, (hundreds of them, it's fast) and the crash will happen.

    Observed Result

    App crash with physics behavior related debug data.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)
    • Safari: (YES)
    • NodeWebkit export: (YES)

    Operating System and Service Pack

    Windows 7 SP 1

    Construct 2 Version ID

    r208 beta

  • Hello everyone,

    I encountered these kind of bugs many times when creating objects on the fly without being able to find the bug or present here a clear capx for debugging. However I'm interested in further investigations about the same subject, probably like other persons as I saw many physics behavior related bugs simply closed because of too few information or no good capx.

    So if the devs can spend some time on it, even if nobody can provide good capx, it would be great.

    I opened a new topic with a clear version of your capx, that reproduces the bug in one event, by just creating objects in chain.

    https://www.scirra.com/forum/viewtopic.php?f=151&t=148526

  • Hello,

    Is it possible to set up a split screen game with this plugin in some way ?

  • Hello,

    One thing you can do is have a sprite for your characters or monsters or whatever, and an invisible sprite pinned to it, with the shape you want, and a little bit smaller for the collision. Thus the laser will overlap with the entity's sprite and will only be destroyed once it has collided with the inner collision sprite.

Nabu's avatar

Nabu

Member since 14 Feb, 2015

Twitter
Nabu has 1 followers

Connect with Nabu

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies