Newbie Question about sprite movements.

Get help using Construct 2

Post » Sat Dec 03, 2011 6:24 am

OK.. I have searched the forums forever and can't seem to find what I'm looking for. I have a character with hundreds of different animations i can get it to walk and stuff with the key board but not the mouse. Using the keyboard works OK, but I would rather have the mouse make the character move, seems much easier for the players... maybe a lot harder on me but that's my fault lol.. I can't get the player to look at the mouse and walk to it, the sprite would have to determine the mouse position the automatically select the right animations.. Hope i have explained well enough for everyone to understand exactly what I'm trying to do...

If this is already posted please direct me to right place
Please Support Ocean Explorer.
http://igg.me/p/735007/x/6915815
B
14
S
4
G
3
Posts: 125
Reputation: 2,645

Post » Sat Dec 03, 2011 7:09 am

here is the file so you can see my char and all the animations, please no making fun of me either. I just need him to move to where the mouse clicks with the correct animations.. please no negative feedback :)

http://dl.dropbox.com/u/51931907/loa.capx
Please Support Ocean Explorer.
http://igg.me/p/735007/x/6915815
B
14
S
4
G
3
Posts: 125
Reputation: 2,645

Post » Sat Dec 03, 2011 7:35 am

hi have you looked here?

faq

mouse click movementvtrix2011-12-03 07:37:14
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 03, 2011 8:18 am

Yes i have seen them, I understand how the single sprites can rotate and go to were the mouse was clicked. I'm trying to use a sprite with animations, if i use that my sprite it just goes side ways and upside down, can't get it to change to a certain animation ans walk towards the correct spot... maybe it can't be done yet with C2... I'm not sure i may be asking to much.. the only way i can do it is with keyboard.. would rather use the mouse but if all else fail's I'll just use keyboard movements.
Please Support Ocean Explorer.
http://igg.me/p/735007/x/6915815
B
14
S
4
G
3
Posts: 125
Reputation: 2,645

Post » Sat Dec 03, 2011 8:21 am

And just for the record I'm working on a simple game, not the next Diablo or anything like that, the movements just very important.
Please Support Ocean Explorer.
http://igg.me/p/735007/x/6915815
B
14
S
4
G
3
Posts: 125
Reputation: 2,645

Post » Sat Dec 03, 2011 8:46 am

yeah i see what you mean its gonna be a little tricky, essential what you need is some kind of pathfinding solution, or you could set a target point get the angle of playerposition to target, compare this to the closest angle of posible movement, set angle and then move forward and do that every so many seconds until target is reached... :) just thinking outloud here...
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 03, 2011 9:14 am

Hmm, what if I made a grid of 8 sprite blocks for all the directions.. and click then to make the character start animations then move toward the correct square... In theory it might work if I can keep the character in the middle of the screen... maybe? I'm not sure... any thought on this idea?
Please Support Ocean Explorer.
http://igg.me/p/735007/x/6915815
B
14
S
4
G
3
Posts: 125
Reputation: 2,645

Post » Sat Dec 03, 2011 9:17 am

ah i maybe found another (part of the )answer, use the position of the mouse related to the player, like if mouseposition is smaller move up, i make example
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 03, 2011 9:20 am

you will need position mouse related to player and then use the" simulate 8direction" action
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 03, 2011 10:02 am

i have this, problem is, the character may only move at one position at a time otherwise it messes up the characteranimation, see i have the x positions disabled

link
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Next

Return to How do I....?

Who is online

Users browsing this forum: Matthew de and 28 guests