oosyrag's Recent Forum Activity

  • You need an expression to get the angle between Sprite1 and Sprite2 with a little math using arctangent (atan(x)).

    The angle between the two is atan((Sprite1.Y-Sprite2.Y)/(Sprite1.X-Sprite2.X)).

    Edit: Never mind!! I didn't even realize there was a specific angle expression for that. Angle(x1, y1, x2, y2) - Calculate angle between two points

  • Layout scale is a system action.

    Set up a condition for when you want to zoom, such as On Start Of Layout. (Or on key press, or touch, ect.)

    Then use the action System - Set Layout Scale.

  • If you want it to go uphill, you'll need to either add force or impulse.

    https://www.scirra.com/manual/98/physics

    [quote:3d57i5m2]Apply force

    Apply force at angle

    Apply force towards position

    Apply a force on the object, either at an angle, towards a position, or with custom X and Y axis forces. Applying a force causes the object to accelerate in the direction of the force. Forces can be applied from an image point or the object's origin.

    Apply impulse

    Apply impulse at angle

    Apply impulse towards position

    Apply an impulse on the object, either at an angle, towards a position, or with custom X and Y axis impulses. Applying an impulse simulates the object being struck, e.g. hit by a bat. Impulses can be applied from an image point or the object's origin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First to address refactoring and compacting your event structure, my advice is to not worry about it at all unless it becomes a problem and you have performance issues! I know how satisfying it can be to go over your code and make everything more compact and efficient, but often the way you first imagined the logic to work out in your head is how you set it up in the first place, and that will be the easiest to understand and read for you later, while extremely compact code might be difficult to decipher later down the road when you have a lot more to think about.

    That said, the simplest solution is often the best solution, so sometimes if you find your code getting too complicated, it might be a good idea to step back and see where things could be simplified.

    In this case, given that your movement is working properly with each direction and diagonals, I would separate the feet animation code from the keyboard input code. Use a variable to keep track of which direction they are going (1-8) and play the correct animation based on that variable.

    You might be able to save some animation frames by using the "Mirror" action too, but that can introduce some new complications as well so I would leave that for after you get it working the way you want first.

  • Remember that everything on the event sheet is run from top to bottom logically.

    So in this case, maybe your mouse is overlapping Family1, so it changes to crossredot. but it is also not overlapping Pickups1, so it immediately changes to crossgrey, so you never actually see crossredot.

    Using the system condition "Else" would be useful here. You can read about it here https://www.scirra.com/tutorials/292/gu ... t-features

  • Here is the manual entry for gamepad - https://www.scirra.com/manual/143/gamepad

    I think what you are looking for is the following expression:

    [quote:1d48ezpy]Axis(Gamepad, Index)

    Retrieve the current position of an analog joystick on a specific gamepad. Index specifies left analog X and Y or right analog X and Y axes, subject to Key mapping. Axes range from -100 to 100. Axis values within the Analog deadzone are returned as 0.

    So use this to get X and Y values that you can use in the arctangent formula.

  • Off the top of my head I believe the best way to pause is to put everything (except the pause code) on your event sheet in a group, then disable that group to pause. This should stop everything and anything from happening.

  • What is your stick? Is it a controller's analog stick (gamepad object), or did you create a touchscreen analog stick with sprites?

    The formula for getting angle in degrees from coordinates is atan(changeinY/changeinX)

    If you are making your own touch analog stick - compare stick's current position to the origin position to get change in Y and change in X, use the formula to get your angle from origin, and then use Move At Angle.

  • You need to set the angle of the particle effect when your character turns around.

    How are you having your character sprite turn around? If you are using mirror, add an extra action whenever your mirror your character, use Particle: Set Angle - 180-self.angle.

    Or you can use a variable to keep track of which way your character is facing, and change the particle angle whenever that changes.

  • Add a "System: For Each - Unit A" to your very first condition.

  • Try starting with the basic example. Go to New Project, and look for Example: Touch - Panning.

  • Use the action:

    Move at angle
    Move the object a number of pixels at a given angle in degrees[/code:j92xkjfx]
oosyrag's avatar

oosyrag

Online Now

Member since 20 Feb, 2013
Last online 25 Nov, 2024

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