How do I change angle with same button

0 favourites
  • 4 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • hi everyone

    I used custom movement behavior with angle

    its like

    space is down player set custom movement angle to 320

    overall speed to 300

    space is released player set custom movement angle to 230

    overall speed to 300

    i want to make it like when you press space when the angle is 320 change it to 230 and when it is 230 change it to 320.

    i try to use variable first text and then number it worked when i first pressed space then it wont change the angle

    it works like only once

    how can i make it work ?

    sorry for my english

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • on space pressed

    -- angle is 320

    set angle to 230

    -- else

    set angle to 320

  • on space pressed

    -- angle is 320

    > set angle to 230

    -- else

    > set angle to 320

    it is same with current build

    what i want is for example when i press space and make it turn right if i dont press anything it goes non stop right after that when i press space again change his direction to left and if i dont press space again it goes left non stop

  • Add a global variable rotation

    on space pressed

    system set rotation = 1-rotation

    system compare two values : rotation = 1

    sprite rotate clockwise

    system compare two values : rotation = 0

    sprite rotate counter clockwise

    You could ofcourse also do this by toggling a boolean instance variable..

    or using an instance variable as above..

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