R0J0hound's Recent Forum Activity

  • Search first.

  • Prominent

    I do not understand what is happening here.

    If in the editor

    sprite2.angle = 95

    sprite3.angle = 240

    And you make an event like:

    Start of layout

    --- create gear joint with phase = sprite3.angle-sprite2.angle

    Then sometimes the objects will rotate 360 before settling.

    However if you set the angles with events then it's perfect.

    Start of layout

    --- sprite2: set angle to 95

    --- sprite3: set angle to 240

    --- create gear joint with phase = sprite3.angle-sprite2.angle

    or you even can do this:

    --- sprite2: set angle to self.angle

    --- sprite3: set angle to self.angle

    --- create gear joint with phase = sprite3.angle-sprite2.angle

    EDIT:

    Ah, I see what the issue is. Internally in C2 angles can be any value. When you access them however, they are always returned in the range [0,360). So it would be a fix from my end. Till I do that the above solution will work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a link with some ideas:

    http://stackoverflow.com/questions/2165 ... y-web-site

    None of them seem perfect though.

  • Prominent

    It's hard to say without a capx. It would be odd if the joint got offset but I suppose it would depend on the joint type.

    Is the dragging similar to this? (from the first post)

    https://dl.dropboxusercontent.com/u/542 ... test2.capx

  • The "else" isn't needed, and the negated != is a double negative, wouldn't it be easier to just check "="?

    This should work. You pick the searcher instance like you have, then you filter the targets that meet the condition, and pick the closest from them.

    Searcher: pick by uid [something]

    Target: var = [something]

    Target: pick closest to (searcher.x, searcher.y)

    --- do something

    That leverages the picking system. If you want to do it a code way you can just use "for each" and "system compare" (same as a if). You can think of a uid as a pointer.

  • You can use the .asJSON expression and the "load from json" action to copy one object to another. For example if you want to create a Sprite that is a copy of the Sprite with a uid of 2 you could do the following.

    Global text template=""

    On click

    Pick Sprite by uid 2

    --- set template to Sprite.asJSON

    --- create Sprite at (0,0)

    --- Sprite: load from json template

    --- Sprite: set position to (mouse.x, mouse.y)

  • You could use a variable to temporarily store the current group as you loop over the passages you're overlapping like this:

    global number curGroup=0

    finn: overlaps passage

    for each passage

    --->set curGroup to passage.group

    --- pick all passage

    --- passage: group = curGroup

    ------> passage: set opacity to 50

  • Look at blend modes, with them you can do masks which is similar to the effect in the link. There is a blend mode example that comes with C2.

    A simple how to would be:

    Add a layer

    Set it's property "force own texture" to true.

    Add a Sprite to that layer that you want to display.

    Add a second Sprite for your erase mask. Set it's blend mode to destination out.

    Now the second Sprite erases from the first where they overlap.

  • That's pretty cool. The art gives it a lot of polish.

  • Maybe ask the people who said they hate Nintendo. I wasn't aware anyone on this forum did.

  • The uid is unique per object. You can find what a created object's uid is with the .uid expression of the object. The new object is picked for the rest of that event or until another create action.

    Every 1 seconds

    --- create: Sprite at (random(100),random(100))

    --- text: set text to Sprite.uid

  • If you want to create an object by name this plugin will help:

    Personally though i'd either just add a event per type to create it or put them all into animations.