oosyrag's Recent Forum Activity

  • Great!

    Just an additional quick tip - you can add additional image points to a sprite besides just the origin point, and get those point positions via expressions for all sorts of uses. You can have different points/locations on different animation frames too.

  • Is this the place for C3 requests? Just wanted to put in my two cents: built in vector graphics support would be great. I know there are some plugins already, but it was one of the most obvious things missing for someone who for example worked with flash before: SVG file support, canvas/drawing support, tweening.

  • Simple solution! Sorry I don't use behaviors much so wasn't familiar with the quirks.

  • It is possible, but quite a bit of a roundabout method. Any particular reason you need to use XML?

    Here is a rough idea of the steps:

    Import your XML file as a project file. https://www.scirra.com/manual/141/files

    Load the XML file into memory with AJAX.request. https://www.scirra.com/manual/107/ajax

    Access the data with AJAX.lastdata.

    Use tokenat() to parse the information you need from your XML file. https://www.scirra.com/manual/126/system-expressions

    Use the information you got to set the Sprite Animation, or to destroy and replace with another Sprite.

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

  • 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

  • Try Construct 3

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

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

oosyrag's avatar

oosyrag

Member since 20 Feb, 2013

Twitter
oosyrag has 38 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