basti's Recent Forum Activity

  • RACR2:

    Try something like

    Cursor.X < Ball.X

    -- Go right

    Else

    -- Go left

  • Ashley:

    In which way are the objects renamed on export? Is there some kind of pattern used? Are the same objects always renamed the same way on export?

    The reason why I'm asking is that I've created a level editor that saves the sprites using the SpriteBank-plugin. The plugin uses sprite names to reference to the sprites when saving, and if the naming changes when you re-export the project (for updates, for instance) it will mess up previous level saved.

    This is not a problem you should worry about - I can replace the names in the save file manually myself, but it would make my life easier if you could tell me how the renaming system works.

    Thanks!

  • The problem is that you're creating an endless loop. The game never gets past the While-statement, so it'll hang there forever.

    It's important that you always have some actions to get out of the loop, and that you understand when you should use a while loop and when you shouldn't. If you for instance remove the While condition in your example the game will work, and the text will still be set to 'Yaaay' every tick.

  • aridale: Making the layer invisible does not automatically make the object property 'Visible' to false (it was made like this in a previous release, if I remember correctly). And I think it should also be this way, since you can check whether the layer is visible using 'Layer Object.LayerNumber is visible'.

    EDIT:

    ramones: Thank you for the clarification, I understand the problem now :) So this is not a bug, it's just how it works when you have several picked objects from the trigger event.

  • Kyatric: it's not only text objects, it's the same unexpected behavior for sprites as well.

  • I have this menu made of several instances of the same text object. The menu is made up of different layers, and each layer is a separate view of the menu (the different layers are set to visible/invisible when navigating).

    The text object has an instance variable GoToLayer containing the number of the layout to go.

    When clicking a text object, it checks if the text object's layer is visible, and if so it sets the new layer visible.

    The event sheet looks like this:

    <img src="https://dl.dropbox.com/s/4vbj6rjhvymks1x/menuexample.png" border="0">

    Everything works well if the text instances are not placed on top of each other in the different layers!

    But the menu doesn't work when the text instances overlap each other, probably because the second condition fails for the instance of the invisible text..?

    So what is the easiest way to make this work (using events)?

    I've included a CAPX here. You can test to run the example as is, and then try moving one of the texts so that they don't overlap.

    Maybe there's a bug in the trigger, when several triggers are triggered?

  • I would also like to have a 'Vertical alignment' property (top, middle, bottom) of the text object. This would be useful when you for instance have a clickable menu, and wish to have a symmetrical space around the text where you can click.

    Is this something that can be implemented?

  • In the editor, select the object and change the 'Set angle' property to Yes (under the Bullet behavior).

  • Check out the changelog for r99, under 'Breaking change'.

  • I think you need a second loop to do this. You shouldn't have to worry about performance, since you only need to run these loops once when the layout starts.

    The system command distance doesn't pick any instances, you cannot count the picked instances like you do above (correct me if I'm wrong).

    I would do something like:

    For each Rock

    • Local number bcount = 0
    • For each Bomb
    • - If distance(Rock.X, Rock.Y, Bomb.X, Bomb.Y) <= 96 Add 1 to bcount
    • Set Rock.bombcount to bcount.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is probably the same problem already described here and here. Are you using 'include event sheet' anywhere in your game?

  • The problem is in the way you are setting the sMY variable using the position of the Mouse. When you're on a touch screen there is no Mouse object to get the coordinates from.

    So change Mouse.AbsoluteY to Touch.AbsoluteY and it'll work.

basti's avatar

basti

Member since 14 Dec, 2011

None one is following basti yet!

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies