mouse click movement

Get help using Construct 2

Post » Thu Jul 26, 2012 3:03 pm

@silvereon:
That action expects an angle and not a position, so you need to use the angle expression:

angle(YourSprite.X, YourSprite.Y, Mouse.X, Mouse.Y)Nimtrix2012-07-26 15:06:20
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jul 26, 2012 3:50 pm

EHRMAHGEHRD!!!!

I cant believe it was that simple. Thanks for that! :D
B
6
Posts: 30
Reputation: 1,260

Post » Sun Jul 29, 2012 1:29 pm

can anyone tell me what im doing wrong on this one? i've also tried using System "Is Between Values" with value being "player.Bullet.AngleOfMotion" and looks like it was only actioning the left movement and down movement.

http://dl.dropbox.com/u/74839448/pointClickPrototype.capx
B
6
Posts: 30
Reputation: 1,260

Post » Sun Jul 29, 2012 2:14 pm

It gets a lot simpler if you use a bit of math to calculate the direction:

silvereonGame.capx (r99)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 29, 2012 3:21 pm

wow - so clean. I have to admit though, that dir value goes over my head but probably something i'll figure out on my own.

Thanks heaps for this, you're really quick to help out :)
B
6
Posts: 30
Reputation: 1,260

Post » Mon Dec 31, 2012 12:14 am

Hello,
*Mouse: Left button is down -> set X to lerp(Sprite.X,Mouse.X, 0.01)
this one work fine, my sprite is after the cursor...

But maybe you know, how to make e.c. if I click backward, the sprite should turn around (change animation, or make mirror)?

Thx
B
2
Posts: 2
Reputation: 304

Post » Mon Dec 31, 2012 12:59 am

@Karvis:
You could make your own thread instead of resurrecting this one. (over a year old)

Anyways, add a condition to check if your character's X position is greater than the mouse click's X position. If Character.X > Mouse.X, set your character to "Mirrored", and if not, set it to "Not mirrored".Nimtrix2012-12-31 01:00:51
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jan 04, 2013 9:01 am

I dont mind if he resurrects it. Actually I went on to play with other features of Construct 2 and had this one on the shelf and completely forgot about this thread.
Thanks for the help!

Based on the help here I made a quick test of the click to walk then tried to add some colission using blocks which I inted to make transparent but somehow it is not working. It blocks the movement the first time it colides but when you click again the player passes through. I've had this issue with a few of my tests on other games and don't know why. Any help will be appreciated.

Anyway here is the CAPX of the quick demo re- done in my latest C2 version I have.

http://www.datafilehost.com/download-2eadbdec.htmlHavok2013-01-04 09:04:06
B
19
S
3
G
4
Posts: 79
Reputation: 3,711

Post » Sun Jan 06, 2013 7:27 am

Anyone have any ideas for me about what is wrong with the collision?
B
19
S
3
G
4
Posts: 79
Reputation: 3,711

Post » Wed Jan 23, 2013 5:32 pm

Anyone?
I've tried quite a few things now and still the character walks through the collision object. Seriously...any help or just a pointer as to what the hell this could be would be really appreciated.
B
19
S
3
G
4
Posts: 79
Reputation: 3,711

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Kagubro and 21 guests