0 Favourites

Set mirrored when the character follows the mice

  • Hello guys,

    Since some hours, I'm trying to search and to fix the problem I have.

    In fact, I'm doing a game, including a character which follows the mice's click to move (you click somewhere and the character comes where you'd click), and I'm searching a way to return the character when he's going to left, with the function "set mirrored". I'm not that good with graphisms and animations, and this version is a prototype, but I can't present it like that, because when I order my character to go to the left side, he's going, yeah, but upside down !

    Thanks !

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I had a similar problem with one of my first projects...

    solved by adding the "Set flipped" action. (and "Set not flipped" when character goes in the opposite direction).

  • Hello TwinTails,

    Thanks for your answer, but in fact, the animation of "not flipped' action make the character turns back, and it's not really discrete in a video game.

    "Set flipped" action make this : http://dl.dropbox.com/u/1412774/C2FlipTest/index.html

    But, if you have an example of capx, where I can find how to code and order the character to be mirrored or flipped when I click to the opposite direction, I would be so happy <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> !

  • The solution will depend on how you've set your character movement so you'll need to provide a capx, the events or an image of the relevant events first

  • Oh yes, I should have think about it before !

    Here's the events we need to solve this :

    Mouse -> On right button clicked -> Target -> Set position to (Mouse.X, Mouse.Y)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Character -> Set angle toward (Mouse.X, Mouse.Y)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Character -> Set bullet speed to 200

    System -> distance (Character.X, Character.Y, Target.X, Target.Y) -> Target -> Set position to (-100, -100)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Character -> Set bullet speed to 0

    In fact, it's a really simple code for the moment, we don't need anything more, but I still can't order to my character to don't go upside down when he turns :c !

    PS : Oh yeah, and I add bullet behaviour to my character, (it was a trick proposed by Ashley in an old topic to make the character moves with mice's clicks )

  • May Ashley take a look here to light me ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
96 57,360
bitworks's avatar
bitworks
Unread hot topic
90 77,102
leonhard's avatar
leonhard
Unread hot topic
88 9,240
goldentreee's avatar
goldentreee