Set mirrored when the character follows the mice

Discussion and feedback on Construct 2

Post » Thu Aug 14, 2014 5:05 pm

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 !
B
3
Posts: 4
Reputation: 175

Post » Thu Aug 14, 2014 9:05 pm

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).
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Fri Aug 15, 2014 9:08 am

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 :) !
B
3
Posts: 4
Reputation: 175

Post » Fri Aug 15, 2014 11:32 am

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
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Fri Aug 15, 2014 12:39 pm

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 :) )
B
3
Posts: 4
Reputation: 175

Post » Sat Aug 16, 2014 10:21 am

May @Ashley take a look here to light me :) ?
B
3
Posts: 4
Reputation: 175


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests