ramones's Recent Forum Activity

  • Change 'Set Angle' to 'No' on the 8Dir behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry I meant adding it to the existing div (id="c2canvasdiv") not creating another div inside.

  • The only case it wouldn't pick the new object is if you have Sprite1: Spawn Sprite1.

  • The border seems to shift the canvas down and to the right. (Like you'd expect but I don't know why it affects the mouse position) What about adding the border to the div around the canvas instead of the canvas directly. That works and gives the same effect.

  • Here's one way: randomColors.capx (r113)

  • Duplicating the layout doesn't duplicate arrays because they are normally global objects. In that capx the AvailableDirections array is not global but if you change it to global it will work.

  • both point makes sense, thanks. <img src="smileys/smiley1.gif" border="0" align="middle" />

    For event 9, how can i leave the function instead of adding the else condition?

    Don't think you can.

    and for event 6, i guess a "wait" action should fix this too, right?

    Nope with wait you'd just be queueing up many function calls to happen after x seconds because the event is still going to run every tick.

    at least, do you know why the enemy UID kicks up this way?

    Not sure what you mean about the enemy UID. Every object has a different UID, every sprite, text object, etc. You have 55+ objects in your layout so it's not surprising that the enemy UID could be 55 or 56.

  • It's not a problem with UID, it's your events. Two things. When movementDirection = 2 then event 8 changes it to 1 and then event 9 changes it back to 2. So the enemy will turn right but never left. You need an else in there.

    The other problem is in event 6. When the enemy is overlapping the object or standing next to a wall the change direction function gets called repeatedly. Every tick you'll be switching directions until you move away. So you need a trigger once in there.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/enemyChangeDirection.png" border="0" />

  • Sounds like you're looking at actions. The option for comparing booleans is a condition.

    For else, right-click the event and go to the 'Add' sub-menu and the last option is 'Add else'. Or the shortcut is select the event and press 'X'.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/togglePunch.png" border="0" />

  • No the event does run because the second condition is true. The problem is with object picking.

    In C2 each event has a selected object list (SOL) that contains all the objects that the actions should act on (AKA the picked objects). The conditions filter that list. If you have an event:

    System: Every tick 
        -> Sprite: Set visible
    

    it will set all Sprites visible because all the Sprite objects are in the SOL by default.

    If you have a condition that references Sprite objects eg.

    Mouse: Cursor is over Sprite 
        -> Sprite: Set visible
    

    That condition filters the SOL to only contain Sprites that are under the mouse.

    So the action (Sprite: Set visible) only applies to those Sprites.

    In an OR block, the actions will run if any condition is true BUT the SOL is filtered by all of the conditions. So your event runs when Light_Switch = 1 but your Downlight_1 object isn't picked (because of the first condition) and so it doesn't get set visible.

    I hope that makes sense.

  • It's working as intended actually according to this:

    http://www.scirra.com/FORUM/r91-or-block-and-picking_topic52579_post330550.html#330550

    The 'mouse cursor over downlight_1' condition being false means that no downlight_1's are picked. You could have it like this:

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/orPicking.png" border="0">

  • Try the Preferences -> Reset Dialogs button.

    https://www.scirra.com/manual/61/preferences

ramones's avatar

ramones

Member since 17 Apr, 2012

Twitter
ramones has 4 followers

Trophy Case

  • 12-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

15/44
How to earn trophies