Flip actor?

Im not sure what to call it, but i will try and explain.

I would like to flip or switch an actor to the other side of the screen.

Example:

Lets say my screen looks like this and the actor is on the white side of the screen, in one spot. How can I get the actor to flip to the opposite side if I press a button. (note: the position of the actor will change so I dont want it to be constraint)

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    Change: Self.X to Display Size.Width-Self.X

  • GamingtilDawnGamingtilDawn Member Posts: 104

    Ok I thought about that, but the only problem is I couldn't figure out how to make that communicate between a button and the player (self).

    I want a button to change the position. I made a boolean attribute for the game, but I dont think thats right.

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @GamingtilDawn said:
    Ok I thought about that, but the only problem is I couldn't figure out how to make that communicate between a button and the player (self).

    Make a game attribute (boolean), let's call it AAA.

    Rule for the button, when pressed . . . Change AAA to 1

    Rule for the player, when AAA = 1 . . . Change: Self.X to Display Size.Width-Self.X

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    ...

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    ...

  • GamingtilDawnGamingtilDawn Member Posts: 104
    edited January 2015

    I had all of that going through my mind. The part I was missing was the game attribute being called in the button. I always forget about those. Thank you!

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @GamingtilDawn said:
    I had all of that going through my mind. The part I was missing was the game attribute being called in the button. I always forget about those. Thank you!

    If you want to keep it flipping back and forth:

    Make a game attribute (Integer), let's call it AAA.

    Rule for the button, when pressed . . . Change AAA to 1-AAA

    Rule for the player, when AAA = 1 . . . Change: Self.X to Display Size.Width-Self.X
    .....................................</font color>Otherwise . . . Change: Self.X to Display Size.Width-Self.X

Sign In or Register to comment.