linkman2004's Forum Posts

  • Give your object two local variables to store the object's previous position, say 'oldX' and 'oldY'. Now, every tick, set the objects angle to angle(Sprite.oldX, Sprite.oldY, Sprite.X, sprite.Y), then set 'oldX' and 'oldY' to the object's current X and Y positions. At the beginning of every frame, 'oldX' and 'oldY' will hold the object's previous position, so you use that to find the angle of motion.

    Let me know if you have any questions.

  • First, I've made an example and then I'll explain it.

    [attachment=0:1ubwgee6][/attachment:1ubwgee6]

    For this trick you need two layers, the "inside" layer and the "outside" layer, where your inside and outside objects go respectively. Your magnifying glass sprite will also go on the "outside" layer. On the "outside" layer you'll have a mask object -- placed above the outside box image, but below the magnifying glass image -- that has its blend mode set to "Destination out", which in a basic sense blends out everything below it on its own layer. For the blend mode to work correctly, the "outside" layer needs "Force own texture" set to true in the layer properties.

    Let me know if you you have any questions.

    EDIT: Looks like I spent too long writing this post, but here it is anyway.

  • I'd suggest using the "Is between values" condition from the system object in your click event. Set "Value" to your enemies current animation frame -- accessed(generically) by Sprite.AnimationFrame -- "Lower bound" to 9, and "Upper bound" to 13. You can also check which animation is playing in the same event if necessary.

  • The bullet behavior has an "Acceleration" property, specified in pixels per second. Setting this to a negative value will cause the bullet to decelerate over time. I would suggest looking at that.

  • It would likely give you an optimization boost to set the layer's blend mode to additive, especially if you have a lot of objects you want to apply the effect to -- simply putting all of your objects with additive blending on a separate layer won't do anything for performance. Just keep in mind that if you do that, the objects on the layer won't blend with each other, so the effect won't be the same when they overlap.

  • You're right, that was more or less a shot in the dark since I can't check it myself. In that case, you'll need to make liberal use of the "Pick nth instance" event from the system object, which will pick a specific instance of an object type from the list of picked objects of that type. To compare variables between objects of the same type when multiples are picked, you can access variables of a specific object by specifying an index in parenthesis after the object name, like:

    Sprite(0).MyVar = Sprite(1).MyVar, do some thing[/code:yku2dx5n]
  • Create another family with the same objects in it, compare between the two families.

  • ImagelessRocket, Post your capx file and I'll take a look.

  • The physics behavior doesn't tend to work well with other movement behaviors, for various reasons. If you absolutely need the physics behavior, you would probably be better off implementing your own platform movement with just the physics behavior. If you're just using the physics behavior for knock-back, you'd be much better off -- and save a lot of headaches -- altering the motion vectors of the platform behavior to represent that.

  • I posted an example a little while back in this thread that should do most of what you're needing.

  • To keep it simple, you can give your character the 8Direction behavior, then in the behavior properties you can set "Directions" to "Left & right". Also in the behavior properties, change "Set angle" to "No" so that the behavior doesn't change the object's angle.

  • When you call "Apply impulse", it applies an impulse to the object that is calling the action. The way you have it, the enemy is applying an impulse towards the player position on itself. Instead, have the player apply a negative impulse(away from the enemy) on itself toward the enemy position.

  • Bullet direction can be set(in degrees) through the "Set angle of motion" action, which objects with the bullet behavior have under the "Bullet" action category. So 0 is right, 90 is down, 180 is left, and 270 is up.

  • I'm not sure how you've reached this conclusion, or why you think it has something to with delta time -- it just sounds like a bug in your events. If you post a capx -- at the very least show a picture of your events -- it would be a lot easier to help you solve the problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • -> on collision with PassiveItems (PassiveItems is a family)

    ->Set key "PassiveItems.Stat" to "Dictionary.Get(PassiveItems.Stat) + PassiveItems.Value"

    Are you actually leaving the double quotes around your expressions? If this is the case, try removing the double quotes and see if it works. Putting anything in double quotes is going to give you a string containing what's inside the double quotes -- this means if you have an expression in double quotes, it won't be evaluated.