How do I make working the vactor X ???

0 favourites
  • 5 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • Hi guys, somehow my Vector X is not working.....just a few pixels maybe....

    in another part the vector Y is doing fine...but here the vector X is not really working...obviously my fault...but why ?

    here is my code...it's like in super mario that after hiting the enemy, the player bounces away for a certain distance of pixels...

    [attachment=0:uc62p08d][/attachment:uc62p08d]

    sorry...I am beginner,....and I really shame in front of so tough guys like U who can code like Pros...

    2 long days...I am tring to see tutorials manuals and asking help...

    thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The deceleration setting is likely changing the vector x back to 0 quickly. Which it is made to do. The solution would be to set the deceleration to 0 before setting vector x. Add a wait action then set the deceleration back up to let it move for a bit.

    ex.

    set deceleration to 0

    set vector x to 100

    wait 1.0 second

    set deceleration to 1000

    ^That will move the object 100 pixels over 1 second. You could make it only take half a second with:

    set deceleration to 0

    set vector x to 200

    wait 0.5 second

    set deceleration to 1000

    You can calculate the distance moved, vector x to use and time to use with this equation:

    distance = vectorX * time

    You just need to have two of the values and you can calculate the other by manipulating the equation.

  • very kind thanks...is it possibile to see a small capx sample ?

    thanks a lot

  • R0J0hound is best person to ask

  • Ah ok I maged it that was super helpful...how can i mange this :

    ...if the player hits from left the enemy, player bounces back left...if player hits enemy from tight,...it bounces to right side

    anyway thanks,,,that was awesome

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)