oosyrag's Recent Forum Activity

  • Here you go, see if this helps

    https://www.dropbox.com/s/gf5pnjr3jcrwr ... .capx?dl=0

    Use arrow keys to move, pin is automatic when you run over the black dot, and press E to drop it.

  • I think it is the wait that is stopping the event from updating the direction of the bullet. Try having the wait and stop in another event, maybe if Bullet is Moving - Wait 1, Stop Bullet by itself.

  • When you disabled wait did you also disable the bullet disable action too?

    Try setting a static speed and see what happens?

  • When working with invisible/instant bullets, I highly suggest avoiding actually using the bullet behavior on a sprite for any sort of hit calculation. Basically with speed 5000, for example, your sprite jumps 5000 pixels every frame - it doesn't actually travel through those pixels. So if your collision object is somewhere in the middle there, the two sprites never touch each other, so there is no collision. It's fine for just visuals though, for example your tracer lines.

    For your hitbox mechanics, you'll need some work in some custom code, since as you mentioned there are no built in behaviors for instant hit projectiles in C2 (also remember all behaviors are just shortcuts, they can all be recreated with the event system).

    You can try using a line of sight style calculation. The condition to check for is if the target is within angle of your shot, which you can base on either the current angle of the player sprite or the angle from the player sprite to your mouse, depending on what your controls are like. When you fire, if your target is within this angle, then hit! From there, you can add sub-events to have % chance to crit, or % chance to hit even when the shot is on target. Then create the visual based on what actually happened. Also, you can use the Line of Sight behavior to make sure there isn't an obstacle between player and target.

    Some angle expressions you might find useful when working on this -

    angle(targetSprite.x, targetSprite.y, playerSprite.x, playerSprite.y) - The angle between player and target.

    angle(mouse.x, mouse,y, playerSprite.x, playerSprite.y) - The angle between player and mouse.

    playerSprite.angle - The angle the player is currently facing.

    random(100) - A random number between but not including 0 and 100

    cel(random(100)) - A random WHOLE number between and including 1 and 100

    I'm working on something similar so let me know if you want a .capx example. I find there's a lot of satisfaction in figuring it out for yourself though!

  • Make sure your pin behavior is on the item, not the player. A simple system would be to pin the item to the player when you pick it up, and unpin when you want to drop it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I assume your coins and life are already variables.

    Condition

    System - Compare two values: CoinsVariable = 100

    Action

    Add 1 to LifeVariable

    Set CoinsVariable to 0

  • Almost there! You've already captured the original X and Y. You need to compare that to where your finger ends up with the Angle() expression to get the angle.

    On Touch End

    Sprite - Set Angle to Angle(Sprite.InitialX, Sprite.InitialY, Touch.X, Touch.Y)

  • A capx would help, it is hard to visualize your situation.

  • Basically it is the same as you did with the first two actions. Try leaving the speed action there and disabling the wait action and see what happens.

  • I can't confirm this will solve your issue, but I have a suspicion the large dimensions of the image may cause bugs with certain hardware. If breaking up your image into 3 or 4 pieces is an option, I would try that to see if your problem goes away.

  • Are you familiar with functions? Use a function for your action, and have two events call the same function.

    -------------+ ----------------------+
    A is True    | Call Function
    [ul]
    	[li]Or -       |[/li]
    [/ul]B is True    |
    [ul]
    	[li]Or -       |[/li]
    [/ul]C is True    |
    -------------+
    
    -------------+ ----------------------+
    D is True    | Call Function
    E is True    |
    -------------+
    
    -------------+ ----------------------+
    On Function  | Actions ect...
    [/code:2ykf7st7]
  • Here's a quick capx with the movingangle working as expected.

    https://www.dropbox.com/s/haxr1kxufixvn ... .capx?dl=0

    See if that works for you?

    It might be the wait that is breaking yours, not the speed.

oosyrag's avatar

oosyrag

Member since 20 Feb, 2013

Twitter
oosyrag has 39 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

21/44
How to earn trophies