Setting bullet speed to a negative value inverts the result

0 favourites
  • 4 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Problem Description

    When setting the speed of a bullet object through an event, a negative value will invert the result when applied twice.

    Attach a Capx

    drive.google[DOT]com/file/d/0BwDq5BPaWAXyaWl3NUJqUVlaX00/view?usp=sharing

    Description of Capx

    Adds a sprite with a bullet behavior. When x is pressed the sprite moves to the left, when pressed again sprite will move to the right, and so on.

    Steps to Reproduce Bug

    • Open a new Empty Project
    • Under Projects window Right Click on Object types, select insert new object
    • Add keyboard
    • Add a new Sprite
    • Upload image or use pen tool to ensure it is visible in some way
    • Under Sprite behaviors add bullet
    • Set Speed to 200
    • Set Initial State to Disabled
    • In the event sheet add a new event
    • Choose on key pressed, set to "X"
    • Add action Sprite, Set Bullet speed to -200
    • Add action Sprite, Set Bullet to enabled
    • Run Layout
    • Press X
    • Observe that Sprite moves to the Left
    • Press X
    • Observe that Sprite now moves to the right
    • Observe that pressing X multiple times will repeat this behavior

    Observed Result

    Sprite inverts it's direction when X is pressed.

    Expected Result

    Sprite should only move to the Left, repeatedly setting the speed to a negative number should not change the movement once the sprite is moving.

    Affected Browsers

    • Chrome: Yes
    • FireFox: Yes
    • Internet Explorer: Yes

    Operating System and Service Pack

    Windows 8.1 Pro

    Construct 2 Version ID

    Release 206 (64-bit)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    Observed Result

    Sprite inverts it's direction when X is pressed.

    Expected Result

    Sprite should only move to the Left, repeatedly setting the speed to a negative number should not change the movement once the sprite is moving.

    not a bug! ....

    steps to fix it... click on your project object.. in the left side... on the object properties you have under bounce of solids set angle... if youl deselect that... your problem is solved Construct2 works like that from beginning! if u want ur angle of the character to change with the movement to be facing right direction u have to set its default angle to the first direction will move that is 180 having the set angle set to yes

    i wold upload u the fixed capx.. but im using r208 ..

  • Closing as won't fix: Construct 2 interprets setting a negative speed as setting a positive speed in the opposite direction. This is easy to work around, and trying to change how this works could break a lot of existing projects, so we'll leave it as is.

  • It wasn't updating speed in the debugger, so thats a little buggy.

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