Newbie Question about sprite movements.

Forum Home Forum Home > Construct 2 General > How do I....?
 Post Reply Post Reply Page  12>
Author
1,116 Rep
Post Options Post Options   Quote bremen Quote  Post ReplyReply Direct Link To This Post Topic: Newbie Question about sprite movements.
    Posted: 03 Dec 2011 at 6:24am
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
Back to Top
1,116 Rep
Post Options Post Options   Quote bremen Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 7:09am
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
Back to Top
4,440 Rep
Post Options Post Options   Quote vtrix Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 7:35am
hi have you looked here?

faq

mouse click movement

Edited by vtrix - 03 Dec 2011 at 7:37am
Back to Top
1,116 Rep
Post Options Post Options   Quote bremen Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 8:18am
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.
Back to Top
1,116 Rep
Post Options Post Options   Quote bremen Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 8:21am
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.
Back to Top
4,440 Rep
Post Options Post Options   Quote vtrix Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 8:46am
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...
Back to Top
1,116 Rep
Post Options Post Options   Quote bremen Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 9:14am
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?
Back to Top
4,440 Rep
Post Options Post Options   Quote vtrix Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 9:17am
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
Back to Top
4,440 Rep
Post Options Post Options   Quote vtrix Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 9:20am
you will need position mouse related to player and then use the" simulate 8direction" action
Back to Top
4,440 Rep
Post Options Post Options   Quote vtrix Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2011 at 10:02am
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
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down