dop2000's Forum Posts

  • R0J0hound Your method works great, as usual. :)

    The only small correction - "set t to loopindex/9"

  • There is also Pin+ addon, which allows you to pin to image point, takes care of mirroring, scaling etc.

  • In sprite font you can get the size of each character, space width, line height etc. This allows you to calculate position of any words in the text, but in a big multi-line text with word wrapping it may not be a very easy task.

    How do you currently scroll the text? Do you have a really tall text object and scroll the entire layout?

  • Your question is too general. You might need to use instance variables, "For each" loops, Timer behavior etc.

    Search for "AI" in the Tutorials section, there are lots of examples there:

    scirra.com/tutorials/all

  • You can pick sprites by animation name. If you want to continue using the family, you'll have to add a bunch of events for creating individual weapons, there is no workaround for this in Construct 2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See this chapter from the manual:

    scirra.com/manual/83/variables

    Local variables are often used when you need a "temporary" variable in an event for some calculations. Note, that local variable is reset on the next tick, so if you use "Wait" in the event, the variable will be reset after it.

    If you need the variable to not reset, you can set it as Static. For example, you can create an event group Audio, add local static variable MusicVolume there. This variable will only be accessible inside the Audio group (which is good, because you don't need it anywhere else) and it will not be reset even if you reset all global variables.

  • I did it! Don't ask me how, but it works..

    dropbox.com/s/8ae8h948w8jt1sa/SineRopeChangeMagnitude.capx

  • Do you mean screen coordinates (x,y), or position (index) of a word in text?

    Text is rendered differently, so it's a really difficult task to get correct screen coordinates with text object. You can do it with sprite font though.

    If you just need to know the position of a sub-string, use find() expression. For example, find("ab cd ef", "cd") will return 3.

  • I'm sure, this can easily be done with asin() expression, this is basically a school-level math. The problem is, I don't remember it :)

    So here is a workaround - change the magnitude gradually over a short period of time. You can do something like this:

    Set newMagnitude=100
    On every tick: sprite Sine set magnitude to lerp(self.Sine.magnitude, newMagnitude, dt*4)
    or:
    On every tick: sprite Sine set magnitude to min(self.Sine.magnitude+1, newMagnitude)
    
  • When you spawn a family, you can't control which family member will be created, it's random.

    So you need to create the object explicitly: "if currentweapon=laser, then create laser, else if currentweapon is missile, then create missile" etc.

    Alternatively, you can ditch the family, combine all these sprites into one as different animations. Then on "Z" pressed, you spawn this one bullet sprite and only need to change its animation.

  • LiteTween is the greatest addon for tweening, you won't find a better one.

    Just set Tweened Property=Value, and set sprite angle to Sprite.LiteTween.Value on every tick while the tween is running.

    However, I just tested and it looks like you can do this by tweening the angle directly. Say, if you want to rotate your sprite 30 degrees clockwise, tween to (sprite.angle+30). If you need to rotate counter-clockwise, tween to (sprite.angle-30)

  • newt Well, of course it's not iterating like "For" loop, the actions in the event are not repeated Object.PickedCount times. But internally, when the engine determines which instances should be picked, it iterates through all instances and compares each with choose(0,1), in each iteration calculating a new result for choose(0,1). It would make more sense to calculate it only once before running this loop.

  • here is an example I made just yesterday, you can modify it to your needs:

    dropbox.com/s/mvllis416491ywn/SlidersTwoLayouts.capx

  • I'm pretty sure you can.