How do I Save the Position of the Mouse

Just started using Construct 2? Post your questions here

Post » Sat Jul 25, 2015 9:23 am

i have set the mouse up to be a character in my game. I need the sprite to mirror the image when the mouse goes left across the screen and not mirror if it goes right.

My first attempts were to compare the mouse.y position to the previous position.
I am not sure how to set it up though. I think I might have to save the position of the mouse every tick and then compare the current position to the saved position. Can someone help me with this?
B
3
Posts: 3
Reputation: 181

Post » Sat Jul 25, 2015 1:48 pm

I don´t know if I understood your problem, if you could specify or make a really simple mockup it would be great.
Either way, I gave it a try. Again, I don´t know if this is what you want:
https://www.dropbox.com/s/xy41teuz8lus3 ... .capx?dl=0
B
9
S
3
Posts: 153
Reputation: 1,272

Post » Sat Jul 25, 2015 6:44 pm

Oops..

I added complete direction, but comparing the oldX should be enough for your needs:

https://dl.dropboxusercontent.com/u/485 ... ction.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 25, 2015 9:15 pm

well thought to find the mouse direction @LittleStain simple and effective
Image Image
B
26
S
15
G
142
Posts: 881
Reputation: 74,060

Post » Sat Jul 25, 2015 9:37 pm

Thank you for all of the quick replies! I will check out the Capx, and see what you have. If it isn't what I am looking for i will show you what i have so far. :D
B
3
Posts: 3
Reputation: 181

Post » Sat Jul 25, 2015 9:54 pm

@CloveltOc
Ok so that isn't quite what i was looking for. Here is the basic set up for the sprite on the mouse. I need the sprite to face the direction it is going when traveling left or right. As of now it only faces right.

@LittleStain
Oh that is pretty flipping perfect! Thank you I can learn a lot from this. :D
B
3
Posts: 3
Reputation: 181


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests