codah's Forum Posts

  • You can use timers or look into lerp() or the LiteTween add-on. These last two can be used to change any value 'smoothly' or in different ways, including your effect value.

  • Sprite: Set effect "Pixellate" parameter 0 to <value>

  • Hi, we can't see what you're doing wrong without a capx or screenshot

  • I actually had another variable on the door to determine whether it's default state was "open" or closed" at the start of layout, but I've added that in myself and it works just fine.

    So it seems changing the toggle state to the switch instead of the door fixed it? Can you give any insight as to what was going wrong with my first attempt? Apart from all the unnecessary for loops

    EDIT: Just read your edit. I had gone through a previous attempt with families but thought that might have been clashing with something and reverted back to the individuals. Honestly I had gotten to the point where I wasn't sure which part was wrong and whether each change I made was breaking something else. I now realise I was over complicating things.

    Yes I often start from scratch when I've 'tried' too many things as they all start to conflict with each other. Definitely the KISS principle applies to C2. And families can be a big help, but there are some gotchas as well. At first I thought you had the free version because your avatar doesn't show it (so I couldn't suggest families) but then I saw you already had one..

  • Hi is this close to what you're after?

    Edit: slight change to capx

    [attachment=1:2tb70m1r][/attachment:2tb70m1r]

    without for loop

    [attachment=0:2tb70m1r][/attachment:2tb70m1r]

    Edit: Comments.. Any reason the block wasn't in the 'heavy' family? And also why weren't you using the family instead of individual objects in a big 'or' block? The comment about 'each door's starting state' is a bit misleading because those events are continually evaluated, not just at the start.

    Basically I started from scratch as the code looked way too complicated. I also used a boolean 'state' variable instead of the text one (personal preference, less error prone).

    I keep coming back to one general design principal: when a change of state occurs, toggle a variable, then 'do all the state change stuff elsewhere'; i.e. in an event that checks for the state variable's value. Don't do things at the point where the state changes. It keeps things simple, clean and readable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > codah can you show a sample of writing it correctly since you said it is possible, for the sake of knowledge.

    >

    I started to but it was late. You can see now why I didn't bother

    It's too bad you can't do something like this Set text Function.Param(0) | "Placeholder"

    I guess because that has another meaning.

  • You don't want to do that.. The ternary ("?:") operator can be confusing to read, and nesting several of them is error prone and generally to be avoided. But yes it is possible. It will have many nested parentheses and be much less readable than the above. Some coding guidelines actually prohibit the use of this operator.

  • Also just discovered I can pass variables to functions.

    And they can return a value too

  • Yea it's nice

  • I have to say, dealing with objects by UID is not normally recommended.. as they will usually be different every run.

  • subtract 180 from the angle?

  • "Nickname" add-on. Search it in the Completed add-ons forum. If I'm understanding your requirements..

  • Pretty much what Katala said, as a function, so you don't have to repeat it

    [attachment=0:2a5k2blg][/attachment:2a5k2blg]

  • No problem. Between tutorials (built-in and forum), templates and FAQ, all of the basics (and a lot more) are covered.

  • There is a "Set mirrored" action on the Sprite object type.

    For the second, search "pick nearest" in the online manual.

    Edit: Have you seen the 9 part Platform behaviour tutorial? Choose the File/New menu, type 'platform' in the top right box, and choose part 1, 2, etc. There is also a Platformer template in that list. Should keep you busy for a while