Santhenar's Recent Forum Activity

  • Well actually, it doesn't quite work...

    When being propelled in the Y axis it works fine.

    However when being propelled along the X axis it still doesn't give the player the momentum that I want. The player will be propelled the number of pixels required, and then appears to hit an invisible wall.

    This is particularly apparent when being propelled at a 45degree angle wherein the player will hit the invisible wall and then the Y axis momentum will cause them to slide up said invisible wall.

    Can anyone think of a way to make it so that the player gets the same movement momentum that they would if I was just using platform controls?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks guys, it works a charm!

  • Hi!

    This is something I've asked for help with in a previous thread (Recoil!), but I've come up with a new way of doing it... And I need some maths.

    So in order to create some recoil for my weapons I need to propel the player in the opposite angle to that which the weapon was fired.

    I figure I can do this using Platform.VectorX and VectorY, but I need to know how to get the correct X and Y values/ratio to give the player depending on the angle which the weapon was fired.

    So...

    If Angle is 0 then I want player propelled VectorX -100 Y 0

    If Angle is 180 then propel VectorX 100 Y 0

    If Angle is 45 then propel VectorX -100 Y 100

    If Angle is 135 then propel Vectox 100 Y 100

    But I need to know the formula than I can use to calculate the X and Y for all directions. I'm sure there must be one. It's maths after all!

  • Hmm... I could perhaps use the SetVectorX and SetVectorY to propel the player in the desired angle, but I don't know what calculations I would need to do to set the Vector X and Y values correctly.

  • Thanks Arcaded, but if I understand this correctly, the object still won't get any momentum if I use EaseTween. Is that right?

  • Thanks signal, but that's not what I'm looking for. But I think I found a better way to describe it.

    I want particles to emit at a perpendicular angle along a plane.

    So if the plane is horizontal then particles will be emitted vertically along it. If the plane is vertical then particles will be emitted horizontally along it. And the difficult part: if the plane is at an angle then the particles need to be emitted at the corresponding perpendicular angle, while still only originating from along the edge of the plane.

  • That's

    "set Floor to Player.X"

  • You can assign a platformer behaviour to the player as well as an 8directional and just use the platformer behaviour for jumping, that way you can use it's built in gravity function.

    Alternatively, off the top of my head...

    Give the player two Instance variables: "Floor" and "JumpLimit"

    --------------------------Set the ground

    When space is pressed:

    Do once while true

    set Floor to Player.

    -------------------------- Jump up to the JumpLimit

    While space is pressed:

    While (Player.X - Floor) < JumpLimit

    [Increase Player height]

    (If you want to make it more realistic then you can reduce the velocity as Player.X - Floor approaches JumpLimit

    -------------------------- Falling

    If player.x > Floor

    [Reduce player height]

    I think that would work okay, the falling wouldn't work on anything other than a flat plane.

  • Hi!

    I'm trying to add recoil to a weapon.

    I have a doomsday laser, and when that laser is fired I need it to give the player velocity and momentum in the opposite direction.

    Currently I have this:

    For the player object:

    set angle to (laser.angle + 180)

    set 8Direction speed to 500

    As far as I know this should be all that I need, but it just pushes the player to the right. If I use the "move at angle" function instead of 8Direction then it works, but the player doesn't gain momentum from the movement, which is not good enough.

    Any help would be much appreciated!

  • I've sort of solved it. At least for my purposes.

    Use ScrollTo to lock the camera onto an invisible object which you can then either pin to the player using the 'rope' method, or use a distance calculator to get it to chase the player when the player is about to leave the viewport area.

    This means that you can have a large border around your playing area which allows the shake to work, but still maximise the amount of the area that the player can see at any time.

  • Yes, sadly that doesn't seem to do anything it all. The particles don't inherit their angle of motion from the emitter.

    You can make the particles emit at a specific angular velocity, but not from an angled line.

    After testing it out by just attaching emitters to an object I've decided that I don't think this is the effect I want. But I'd still be curious if anyone can find a way to do it.

  • Potential solution: Create many image points along a rectangular object and spawn an emitter at each point. Closest so far.

Santhenar's avatar

Santhenar

Member since 24 May, 2013

None one is following Santhenar yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies