0 Favourites

How do I set the bullet speed correctly

  • Hi there

    I`m working on a Platformer-Game and have a Problem with the Bullets. When i shoot at Idle the Bullet spawns with the Bullet Speed, works fine. But when i shoot and walk the Bullet spawns as well in the Bullet Speed. I think its wrong. When i walk the Bullet Speed have to be: BulletSpeed+PlayerSpeed. So how can i realize it? I have try it to make a Event that ask how is the Player Speed an than i set the Bullet Speed to BulletSpeed+PlayerSpeedVariable. The Problem is i dont know how to ask the correctly Player Speed. I have tryed to set the PlayerSpeedVariable to PlatformBehavierSpeed. But it sets the Speed when i stand still to nothing. When i walk it works. But when i Jump Forward it set to nothing and when im falling forwart it sets to nothing. As well he set the Speed when i stand and jump to jumping strength. Its always static and not dynamic to the real Player Speed. Also i have to separate the X Speed and Y Speed? Or only take the X Speed. its enough.

    Anyone can help me? Or do i think wrong?

    *excuse my bad english*

    -----------------

    Edit:

    If it helps there is a capx: https://www.dropbox.com/s/i9ymvuce9b3if ... .capx?dl=0

    But i have deleted the variable bacause it dosent works.

    You can find the Position on Layer Game->Chars->Krigel->Player1->Shotgun->shoot_Krigel->Shooting

    It only can be played with a XBox Controller at time. Move =D-Pad, Jump= A, shoot= X

    Its my fist time i use construct 2 so dont be to hard if it is not programmed so smart <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

  • Here's an alternative approach. Create instance an instanc variable called Action for the player and make it text

    When the players movement state changes, set the "Action" like; "Stop", "Walk","Run","Jump" etc..

    Then use subevents with compare instance varible.

    Bullet 》On Created

    》Player 》"Walk" 》Set Bullet.Speed 》 Bullet.Speed +30

    》Player 》"Run" 》Set Bullet.Speed 》 Bullet.Speed +60

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • TheDom

    Thanks for answering.

    I have make it like this but set not a fixed number like +30 or+60. I have used the Platform Vectory X or Y. Now it works fine. Thank you.

    -------------------------

    Edit:

    Ok it dosnt works so fine. The Problem is when i shoot again with an other BulletSpeed, the Bullets who Spawn earlyear Change the Speed to the new BulletSpeed. How can i fix that?

    Ok, i fix it with settig the command to the bottum, dont know why it works but it works

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