Santhenar's Forum Posts

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

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

  • Try Construct 3

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

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

  • Hi!

    Currently I have a nice arena for my 2D shooter, the arena is about 3 times the size of the viewport, so when the player is in the middle of the arena they will be in the center of the viewport, but as they move to the edge of the layout, the viewport will stop scrolling and the player can move to the side of the viewport.

    I really like this effect and it's how I want my game to work, but the problem is that the camera shake function does not work when the viewport is pressed up against the edge of the layout like that, and the camera shake function is pretty important for what I'm trying to do. I know you can unconstrain the viewport, or increase the layout size, but that means that the player is always in the center of the viewport which is not what I want.

    I'm sure this is a problem that lots of people have run into, so I really hope there's a solution as the camera shake function is really great apart from that.

    Thanks for any help!

  • Or otherwise, can I emit particles along a line which can be angled?

  • Hello again dear forum!

    I would like to be able to angle a particle emitter.

    What I mean by that is this:

    I can use a particle emitter to create a column of swirling particles using the X and Y randomiser features of the emitter. By tweaking these I can make a particle-filled quadrangle of any size, but it will always be vertical. Want I want to be able to do is to change the angle of the quadrangle. So I can create a sort of particle-beam which can be oriented to any angle/direction.

    Any thoughts would be greatly appreciated!