dop2000's Forum Posts

  • You should try removing all external plugins from the project before posting it here. Or post a screenshot of the code.

  • EDIT: one important note is that, obviously, if the patrol is turning 5 degrees (or -5 degrees) per tick, then you have to make sure the angle of the trigger is a multiple of 5 - otherwise the angle of the patrol will never match up with the angle of the trigger and it will just spin around on the trigger forever...

    I suggest using "Rotate towards" action, it will rotate the sprite correctly. Say, if the difference between angles is 3 degrees, "Rotate 10 degrees towards angle" will rotate the sprite by only 3 degrees.

    Another way to do this is with Pathfinding behavior - for each enemy find path to the next patrol point. Pathfinding will take care of sprite rotation, acceleration/deceleration etc.

  • Probably the easiest solution would be to remove that "Set angle" action and add another event:

    On every tick: Enemies rotate 5 degrees towards Enemies.Bullet.AngleOfMotion
    

    In Russian: "На каждый тик: Enemies повернуть на 5 градусов к Enemies.Пуля.УголДвижения", что-то в этом роде :)

  • Another option is to do this with a couple of variables.

    Mouse On sprite clicked
    ....Set variable lastClick to time
    ....Set variable clickedUID to Sprite.UID
    
    Mouse On left button released
    Mouse Cursor is over Sprite
    Sprite pick by unique ID = clickedUID
    Compare variable lastClick<(time-1)
    ....Sprite destroy
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is this is a top-down game? What behavior are you using for the character and NPC movement? With Bullet, you can use "Bounce off car" action instead of making the car solid. With other behaviors it may be trickier. One option is to temporary disable collisions for the character for the duration of the jump.

    Also, instead of that bunch of "Set scale" and "Wait" actions I recommend using Sine or LiteTween behavior. It will look much nicer and you can use LiteTween's events like "On tween end" to detect when the jump has ended.

  • What you described should work, maybe you did something wrong. See this example:

    dropbox.com/s/b7k3gbkzdf08bnk/RotateDemo2.capx

  • ... or floor(random(1,6)) or int(random(5)+1)

  • Are you compressing images using some external software, or this option?

  • That formula for RND is wrong. Values 2,3,4 will appear more often than 1 and 5. Sometimes no pedestrians will be spawned, or several pedestrians can be spawned at the same time.

    If you need to spawn 1 pedestrian every 1 second, instead of RND use "System Pick random instance" event.

    So remove "RND=1" condition, add a sub-event under event #7 and put "System Pick random Spawners" there.

    If this doesn't fix the issue, the problem may be with two other conditions - Spawners overlapping sidewalk, and Spawners is on-screen. You can try to debug it. For example, in event 6 set Spawners opacity to 50. In event 7 set their opacity to 100. You should be able to see which spanwers are picked by event 7 (overlapping sidewalk and on-screen), they will have 100% opacity.

  • Do you need to allow players to type in this textbox? Or is it only for displaying the text?

    If you only need to display text, I recommend using Text object instead with this addon:

    construct.net/en/forum/extending-construct-2/addons-29/behavior-scrolling-for-text-sp-47715

    • Post link icon

    Thanks, DiegoM, for this great new feature!

    Will it be possible to add "On keyframe reached" triggered event? I'm not entirely sure how it will work with different instances and properties, but this would definitely be a useful addition.

    Let's say I want to change animation frame of the sprite at the keyframe. Currently the only way to do this is to compare Timeline.Time or Progress on every tick, which is not very convenient.

    I guess this can be worked around with an instance variable, which you set to different values on each keyframe, but I can't test it - my C3 crashes all the time when I'm trying to add instance variables to the timeline...

  • Do you mean when several red sprites are overlapping each other? I'm afraid you will need to keep each pair of sprites (red+shadow) on a separate layer.

    .

    There may be an effect you can use instead, a gradient mask or something like that, see this post:

    construct.net/en/forum/extending-construct-2/effects-31/webgl-effects-list-51897

    .

    Spawning without overlapping is one of the most popular questions here. Try searching the forum and you should find lots of examples. Here is one:

    construct.net/en/forum/construct-2/how-do-i-18/ideas-for-randomly-spread-out-142100

  • You can do this with blend modes. Both sprites need to be on the same layer with "Force own texture" enabled.

    The "Ball" sprite should have a gradient from black or grey to transparent (not to white). Put the ball above the red sprite and set "Source atop" blend mode for it. See this demo:

    dropbox.com/s/w77ytyb6wxfnuj0/BlendMode_BallMask.capx

  • Repeat choose(3,4) times

    System create object, Layer:N, X: random(0, LayoutWidth), Y: ViewPortBottom(N)

    Where N is the name or number of the layer where you want the object to be spawned