oosyrag's Forum Posts

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

    Try setting a static speed and see what happens?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • How large is your picture?

  • I use subevents to simulate and/or.

  • Try this - https://www.scirra.com/tutorials/318/ho ... ng-screens

    Although... doesn't C2 already have a loading bar by default? Or maybe that was an older version

  • I would use two sprites, one for the enemy, one for the eye.

    You can pin the eye sprite to the enemy sprite so that they move together.

    The eye sprite should be slightly off center from its origin point.

    Every tick, set the angle of the eye sprite towards the player. You can get this angle by using the expression angle(eye.x,eye.y,player.x,player.y)

  • It should work. Try disabling the speed, wait, and disabled actions to test again?